Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Audio in Timeline is not respecting 2D vs 3D audio source values

Discussion in 'Timeline' started by jmguillemette, Sep 19, 2017.

  1. jmguillemette

    jmguillemette

    Joined:
    Mar 4, 2015
    Posts:
    17
    All audio played via Timeline is played as 3D audio. This results in audio that shifts from left to right and in volume even when the audio source is set to 2d and is attached to the camera.

    I'm trying to build a missing briefing sequence and this is resulting in audio fading and shifting where the desired audio should be consistent and mono.

    if I've missed a setting... I welcome any help anyone can suggest.

    j.
     
    P_Jong likes this.
  2. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    79
    point the audio track to an audio source in your scene and then you have full controller whether it's a 2d sound versus 3d w/ positional information.
     
  3. Artline

    Artline

    Joined:
    Feb 21, 2017
    Posts:
    3
    Did you find any solution to this?

    I have the same problem. I want to add music to a timeline and control the volume but if I add an audio source 2d to timeline the music sound in 3d anyway.
     
    P_Jong likes this.
  4. P_Jong

    P_Jong

    Joined:
    Jun 14, 2017
    Posts:
    23
    This is for certain a bug. My timeline does not even have an audio source attached. Yet I'm experiencing the following:
    My timeline has a track that activates an object with an audio source set to 2D spatial blend and play on awake . My timeline does not even have an audio source component. Yet sound is coming from the timeline and not the object just activated. And it is always set to 3D. Right now I'm having to move the timeline location to the player so they can hear. The desired outcome is timelines should not be an audio source. The audio source should be from the object being activated by the timeline. @mikew_unity
     
  5. DoctorShinobi

    DoctorShinobi

    Joined:
    Oct 5, 2012
    Posts:
    55
    Hey, just found this thread because I also have this bug. This occurs using Unity 2018.1.0f2
    Edit : My track is also referencing an audio source that has Spatial Blend fully set to 0(2D)
     
    P_Jong likes this.
  6. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    482
    I have a similar bug. Changing the Audio Source Volume is not working as expected. The Audio Track is linked to a Audio Source on my scene, but the changes on Audio Source Properties (Volume or any other) does not reflect on the Audio being played on timeline.
    Using Unity 2018.1.f2
     
    P_Jong likes this.
  7. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    482
    @mikew_unity Please, tell me that there is some workaround for this Audio Volume problem with Time Line. I need to generate a final build very soon, and need this to be fixed.
     
    P_Jong likes this.
  8. DoctorShinobi

    DoctorShinobi

    Joined:
    Oct 5, 2012
    Posts:
    55
    If you need to generate a final build very soon then don't wait for Unity to fix it. Create your own track/clip/mixer that plays an audio source directly from reference. That's what I did and it works for the time being.
     
  9. Fsora

    Fsora

    Joined:
    May 18, 2017
    Posts:
    1
    I have this bug too in 2018.1.1f1,but my problem is I can't play a 3D sound.
    Out of max distance, I still hearing the sound
     
    mgeorgedeveloper likes this.
  10. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    51
    @Fsora correct - my audio source is set to fully 3D, and I can see the listener distance being tracked on it in play mode, but it makes NO DIFFERENCE to the volume when Timeline is playing clips through that audio source. It's 100% a bug.

    @mikew_unity any chance you can look into this? I can't easily report a reproducable bug with a 30GB project. I'm pretty sure this is happening to everyone.

    EDIT: some more information - basically, the audio source you attach to the track is ignored. It is as if a new audio source is dynamically created at co-ordinates (0,0,0) and this audio source is set to 3D, with a very long range. I came to this conclusion by placing an audio listener at (0,0,0) in the scene, and then moving it around in play mode to see how it reacts to the audio track in Timeline. So, there's a bug where the audio source on your Timeline track is ignored, and instead a default, dynamically created one is used (my guess is, some code was added to create some kind of default audio source if none is attached to the track, but the code has a bug).

    EDIT 2: well, it's behaving "as if" an audio source is created, but it's still seemingly using the audio source you attached, but bypassing every single setting + the distance from it (for 3D audio).
     
    Last edited: May 31, 2018
    SpencerPDX likes this.
  11. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    131
    mgeorgedeveloper likes this.
  12. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    51
    Hi, do you have a link to the bug report page? This thread seems kind of dead.
     
  13. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    131
  14. bfe_gio

    bfe_gio

    Joined:
    Apr 7, 2016
    Posts:
    9
    Found a workaround for this. If you play a sound through the bound AudioSource via any non-Timeline means, the Timeline will subsequently play its own audio with the right 2D/3D settings. PlayOneShot works for this, for example:

    Code (CSharp):
    1. public AudioSource source;    // The AudioSource bound to the Timeline
    2. public AudioClip silenceClip; // An AudioClip, consists of a tiny bit of silence
    3.  
    4. private void AudioTrackWorkaround()
    5. {
    6.     source.PlayOneShot(silenceClip);
    7.     // Now any Timeline can use this AudioSource
    8.     // as a binding target and work correctly
    9.     somePlayableDirector.Play(myTimelineWithAudio);
    10. }
    That's a bit abbreviated, but it's more or less what I did and it seems to work. It is technically doubling the total number of sounds played, even if just for an instant, but for our purposes that was ok.
     
    Last edited: Jun 27, 2018
    mgeorgedeveloper likes this.
  15. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    131
    Forgot to update this thread but in the other one I link to I replied:

    "I heard from someone at Unity who said that the issue sounds similar to one they had with audio from a video player, and that it should be fixed in the 2018.2 beta. I tried out that beta and it seemed to work in some ways, i.e. I am now able to hear a difference along the Spatial Blend between 2D and 3D. Unfortunately I now have at least one important object that inverts the binaural sound: i point my left ear at the source of the sound and I hear it in my right. However another object set up exactly the same way (as far as I can tell) works fine."

    That inversion issue was apparently my own fault, as Unity QA replied:

    "Seems like the audio object had it's Audio Source's Spread set to 360, which results in audio being flipped.

    https://docs.unity3d.com/ScriptReference/AudioSource-spread.html
    "0 = all sound channels are located at the same speaker location and is 'mono'. 360 = all subchannels are located at the opposite speaker location to the speaker location that it should be according to 3D position. Default = 0."

    Setting it back to 0 should make the sound return to normal."

    That worked too.
     
  16. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    51
    Good job, this works :)