Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Split Screen Audio has been released! Official Support / Q&A thread here!.

Discussion in 'Assets and Asset Store' started by LunaArgenteus, Oct 11, 2014.

  1. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
    Have you ever wanted to create a split screen game, but were stumped when you found out that Unity only supports one AudioListener in the scene? Fear no longer! Split Screen Audio is a tool that allows users to quickly set up multiple Audio Listeners and play back audio clips using one of three methods.

    http://u3d.as/content/luna-argenteus/split-screen-audio/9HL


    It works with any number of players!

    You can:

    A) Set sounds to play through the left or right speakers (or somewhere in between) based on which listeners can hear them. 3D functions like doppler and rolloff are still available with this method though!

    B) Set sounds to only play for whichever listener is closest. Sounds can be set to be able to switch the target the play for mid clip, or to be locked to whichever player the start playing for until the end of the clip. This is efficient, but perhaps not as accurate as the third method:

    C) Set sounds to play for all players in a way that you'd expect to hear it. The sounds are layered on top of each other and the volume is adjusted to make it sound like every listener can hear the sound as they should!


    Try it for yourself with this web player demo!


    (Warning headphone users, it can be a little loud when the sounds get right next to the cameras)

    If you have any questions, I'll try to answer them here in a timely fashion.

    Talking about code questions is fine, but please refrain from posting large chunks of the asset's code in this thread.

    Cheers!
     
    Last edited: Oct 22, 2014
  2. dizzywhip

    dizzywhip

    Joined:
    Mar 17, 2014
    Posts:
    6
    I was just thinking of ways to solve this problem for my multiplayer game the other day. Really excited for this!
     
  3. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
    I've just submitted the asset for review! Hopefully it will go live by sometime next week! When it does, I'll turn this thread into the official support / Q & A thread for it.
     
  4. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
  5. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Hi

    I have issues with my split screen audio, and have discovered this asset on the store...

    Now, as it seems Splitscreen Assets live a rather short live (I used the Splitscreen Manager asset until now which has gone the way of the Dodo it seems) I wanted to ask first: is this Asset still actively developed and this thread monitored?

    If it is, here my use case: I need the audio from 2 audio listeners mixed so that they are layered on top of each other. I would like to make full use of Unitys Audio System, so yes, I need reverb zones.
    Is this possible with this asset? Can reverb zones be used? If not, can I achieve a similar effect somehow?
     
  6. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
    Audio reverb zones are currently not supported, though I think I could add support for them with the closest listener and multi source modes. Judging from what you said, it sounds like you'd want to be using the multi source mode (option C from the original post), rather than either of the other 2 modes, right?

    I'll work on trying to implement reverb zone functionality sometime either later today or tomorrow and let you know how it goes!
     
  7. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
    So I discovered that reverb zones work by applying reverb effects to the audio output specifically based on where / when the AudioListener is within the reverb zone. This is problematic because Unity only supports one AudioListener.

    The way to get around this would be to apply the reverb on a per AudioSource basis instead of a per AudioListener basis, but that would require access to AudioFilters. Unfortunately, that's a Unity Pro only feature, so I can't access that to implement it myself. However, if you own Unity Pro you could still add the functionality yourself.
     
  8. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Thanks for the quick answer.

    Fortunately I have a Unity Pro license. So your idea with the Audiofilters might work for me.
    If I understand you correct, I should apply the filter to the effects based on their distance to the "virtual reverb zone", right? So I could work with triggers instead of reverb zones basically....
     
  9. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
    Yep, that's right! You still might want to implement your own method to determine the intensity of the reverb though, as it might be tough to create a reverb gradient with triggers. For example, a simple distance calculation with a min / max magnitude would work fine for this, just like the one Unity's AudioReverbZone has.
     
  10. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    I got your asset from the store, but will only be able to try it out next week or the week after. I will try to implement some kind of reverb system like what you described, might come back with a question or two.
     
  11. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
    I'll be happy to help as much as I can without having access to Pro myself. Let me know how it goes for you!
     
  12. bbricker87

    bbricker87

    Joined:
    Sep 2, 2014
    Posts:
    3
    Hello, I just downloaded your asset. I have a few questions on it.

    If I have, say a couple of cars, and they each play the same alarm, do I need to add two gameobjects with an audio source attached to each one? I know that for each car I would add the virtual audio source that I want to use on it but I wasn't sure if they should each have their own main audio source or not. I'm guessing no.

    Also, what should I call to stop the playback? I've tried stopCoroutine and stopAllCoroutines but neither of them seemed to turn the audio source off.

    Aside from that, this is a great asset!


    Edit: Think I figured this out. The audio source I was playing was on a loop, so it just kept going forever. It seems to stop now though.
     
    Last edited: Feb 25, 2015
  13. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
    You should have one VirtualAudioSource for every AudioSource: if two cars share the same AudioClip but are each their own source, you should have two VirtualAudioSources linked to the two real AudioSources in the scene. However, if the two cars share a single source, then there should also only be one VirtualAudioSource.

    Looping and stopping are still controlled by the original AudioSource - The VirtualAudioSource will correctly continue to update or stop its coroutine immediately if .loop is enabled or .Stop() is called respectively. I suppose I could update the asset to include corresponding VirtualAudioSource methods for the functions not directly managed from them so users would only need to reference the VirtualAudioSource in their other scripts, but the only thing the new methods would do would be to call the AudioSource's corresponding method.

    Edit: I just submitted an update to the asset store with this change, since I realized that particularly with the multi-source method, it was somewhat unintuitive to update the audio sources. Hopefully it'll be live in the next couple days.

    Glad you're enjoying the asset!
     
    Last edited: Feb 26, 2015
  14. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
    The new update is now live and is available to anyone who has purchased the asset!
     
  15. lasersinc

    lasersinc

    Joined:
    Apr 21, 2013
    Posts:
    12
    Hi,

    Quick question. I notice that in your example scene, the AudioSource objects are in the root of the scene, whilst the VirtualAudioSource objects are children of the objects to which the sounds are attached. Is it necessary to have the AudioSource objects in the root, or at least not transformed by objects which the VirtualAudioSource objects are attached?

    Thanks!
     
  16. sligit

    sligit

    Joined:
    May 25, 2015
    Posts:
    12
    Hi,

    I can't find any equivalent of AudioSource.PlayOneShot(). Am I missing something or is this not possible with this asset?
     
  17. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,716
    Does it workf or Unity 5+?

    It's so dumb Unity is still stuck with the stupid notion of a single listener.
     
  18. Joflores

    Joflores

    Joined:
    Oct 3, 2017
    Posts:
    1
    Hi, is this asset OK to use for commercial purposes? Specifically for internal prototyping?
     
  19. Praetorsoft

    Praetorsoft

    Joined:
    Oct 9, 2016
    Posts:
    14
    I'm using this asset for a splitscreen racing game in 3D and it's exactly what I need. But I'm having some issues with it. It works as it should, but the sound is often garbled. Hard to explain it. It sounds normal and but also some gurgling sound, especially easy to hear on the engine sound which is looped. I use Edy's Vehicle Physics if that matters.

    Update:
    I manage to solve the problem. It has to do with the doppler effect. For each audiosource copy the VirtualAudioSource_NormalizedMultiSources.cs script make I now specifically set the doppler effect to zero. Now it's working great.
     
    Last edited: Oct 10, 2017
  20. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello! Is this asset still supported with Unity 2018.3?
     
  21. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
    Hi there! I no longer actively support this product, but it may still work in Unity 2018.3 if there haven't been significant upgrades to Unity's methods of playing audio.
     
  22. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Thank you! But I found another asset that is still supported!
     
  23. Badchrono

    Badchrono

    Joined:
    Nov 27, 2016
    Posts:
    1
    [QUOTE = "mattis89, post: 4343203, membro: 1257987"] Obrigado! Mas encontrei outro ativo que ainda é suportado! [/ QUOTE]

    If possible, put the link to the asset that works on the latest versions of the engine.
     
  24. DenisGLabrecque

    DenisGLabrecque

    Joined:
    Jul 29, 2017
    Posts:
    7
    Note: it only crashed when the AudioSource and VirtualAudioSource were on the same game object.

    It's not crashing now, but not working either... my setup of AudioListener on one game object, VirtualAudioSource on another game object [AudioS] (with assigned AudioSource as sub-game object [AudioSource]), and Camera game object with VirtualAudioListener [AudioListener] as a sub-game object to both player's cameras should be fine, I think ?

    I can hear sounds in the world (because of the single AudioListener), but am not hearing the one assigned to the virtual audio source.

     
    Last edited: Aug 31, 2021