Search Unity

Audio Audio playing via Timeline breaks Spatial Blend, jumps between ears

Discussion in 'Audio & Video' started by SpencerPDX, Jun 13, 2018.

  1. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    Hello!

    I've got a VR project heavily reliant on Timelines, playing a lot of audio clips, being developed on Oculus Rift with mobile VR the eventual target platform, on a project recently updated from Unity 2017 to 2018.

    Having a problem where audio played via Timeline doesn't do spatial blending properly.
    • I have an object with Audio Source component in my scene, with the AudioClip field empty, for use with Timeline.
    • In timeline I add the Audio Source object as an audio track and add clips to it.
    • No matter how I set the Spatial Blend settings - whether 2D or 3D or anywhere in between - when I play the scene the audio is, I guess you would say, too extremely spatialized. That is, with the audio source directly in front of me, and even if I have Spatial Blend set to 2D, the slightest turn of the head causes all audio to be played in the ear that is more pointed toward the Audio Source. And I mean the SLIGHTEST turn of the head puts ALL the sound in one ear. Even leaning the head slightly without turning causes all sound to jump into one ear or the other.
    • As a test comparison I added a new Audio Source to the scene, added a clip to its AudioClip field, set it to play on awake and loop, and turned off the audio from the Timeline. The new Audio Source - not played via Timeline - played as expected. I.e. I put the spatial blend midway between 2D and 3D and the sound seemed to surround me in VR but with something of a sense of it being in front of me when I turned my head. As opposed to the extremes of left and right audio when played via Timeline.
    • As a further test, I tried feeding the Timeline audio through the new Audio Source, but that broke the audio again. So the problem seems associated with audio played via Timeline.
    As mentioned, I recently updated from 2017 to 2018 and am not sure if the issue popped up with the update, or if I just suddenly noticed it after.

    Any help would be greatly appreciated.

    Thanks!

    -Spencer
     
  2. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    324
  3. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    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.

    Anyway @mgeorgedeveloper if you're having these sound problems you might want to give that beta a shot.
     
    mgeorgedeveloper likes this.
  4. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    324
    You won't believe the hacky lengths I've gone through to produce the trailers based on Timeline.

    Basically, I had to output all the timeline audio through a single 2D source, making sure the audio listener is at a fixed position and the audio source is at a fixed position nearby. Then, I ran the actual timeline, recording the audio. Next, I saved the audio clips into various wav files. Those are then attached to the actual game objects meant to produce the sound, and then played in the final version of the Timeline via the regular audio sources attached to those objects, received by the regular camera-attached audio listener. At that point of course, the audio tracks on Timeline would be disabled.

    Anyway, final results here:

    https://twitter.com/infingame/status/1007355616082489345

    https://twitter.com/infingame/status/1007936616453861377
     
  5. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    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."
     
  6. bjornsyse

    bjornsyse

    Joined:
    Mar 28, 2017
    Posts:
    102
    This still seeams to be an issue, is that right? I'm not getting my timeline sounds spatialized..
     
  7. GrooveJones

    GrooveJones

    Joined:
    Aug 19, 2016
    Posts:
    11
    Also still having this issue. spacialBlend.PNG
     
  8. TristanCS

    TristanCS

    Joined:
    Sep 30, 2016
    Posts:
    6
    I have this issue on only one of around 20 audiosources controlled by timelines in a scene, using 2019.4.18f1. I'll see if deleting it and replacing it makes the problem magically go away.

    Edit: It did.
     
    Last edited: Jul 10, 2023