Search Unity

  1. Tune in to get all the latest Unity news live from Berlin on June 19, 6pm CEST. Set up a YouTube reminder!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

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:
    124
    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:
    40
  3. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    124
    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:
    40
    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