/ Forums
New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

Spatial Blend in Unity not working

jlinkjlink Posts: 19
Virtual Boy (or Girl)
We recently updated our project to Unity 5.5.2 (from 5.5.1) and it seems like the spatial blend setting for audio sources stopped working on our Oculus spatialized sounds.

We're dynamically generating audio sources from preset data and all of our settings are getting applied to the audio sources from what I can tell, but for whatever reason the spatial blend doesn't seem to be working anymore. On the sources in question, we're setting spatial blend to 0.5 for a mix of both 2D and 3D spatialized audio. However, when out of range of the source (a couple meters) the audio can't be heard at all. I did go through our code that instantiates the audio sources to make sure that we're setting the source's parameters with ONSPAudioSource's SetParameters method, but that didn't solve our issue.

Did the Oculus audio plugin for Unity stop supporting spatial blend settings, is this a bug, or am I missing something else?

Comments

  • PeterStirlingPeterStirling Posts: 109 Oculus Staff
    Hi jlink,

    I'm not sure about the status of spatial blend because it's not a feature we use or test internally. I don't think we have done anything on our side to break it but I could be mistaken.

    Stepping back a bit I'm curious to understand how/why you're using this feature, as there may be a better approach. Spatial blend does not work well with 3D audio because a integral part of the HRTF is the inter-aural time difference (ITD), which is the delay from one ear to the other. Given the original mono signal will not have any delay, when mixing them together it will result in comb filtering which is not desirable. The ITD varies based on the angle the sound is coming from so it will be like a phaser effect when the listener turns their head.
  • jlinkjlink Posts: 19
    Virtual Boy (or Girl)
    Hey Peter. I forgot that I had posted this and didn't get any notifications you had replied!

    Anyway, here is our use case. We have audio that we want spatialized, but also non-spatialized depending on the user's distance from the source. The purpose is so that when a user is up close, they get spatialized audio but when they move away from the source, it remains in the background instead of falling off completely. Specifically what we're doing is using different audio sources as musical elements. We want the audio to be spatialized so that it feels as real as possible when they're close. However, we also want that audio to fall into the background audio layer when they move away so that it can be a part of the overall music track.

    The combing effect you're describing makes sense given the settings I described. Is there a better solution to do achieve what we're trying to do?
  • PeterStirlingPeterStirling Posts: 109 Oculus Staff
    OK interesting, that is not a use-case I have encountered before. Generally people use the spatial blend parameter to make sounds wider so they can envelop the listener when it's very close, for this we have a better solution coming soon. For your use-case of transitioning to non-spatial when it's _far_ from the listener is a weird one, I'm not sure of a better solution than what you're trying for that. I'll see if our Unity expert can shed some light on your original question about the status of the spatial blend feature in Unity.
  • jlinkjlink Posts: 19
    Virtual Boy (or Girl)
    OK interesting, that is not a use-case I have encountered before. Generally people use the spatial blend parameter to make sounds wider so they can envelop the listener when it's very close, for this we have a better solution coming soon. For your use-case of transitioning to non-spatial when it's _far_ from the listener is a weird one, I'm not sure of a better solution than what you're trying for that. I'll see if our Unity expert can shed some light on your original question about the status of the spatial blend feature in Unity.
    Any news here?
  • pgiokarispgiokaris Posts: 5
    Hi jlink,

    Sorry we haven't responded about this sooner. There have been no changes in the way the Oculus spatializer plug-in works. It sounds like you are seeing the issue when going from 5.5.1 to 5.5.2, but you are using the same plug-in version. Is that correct? If so, then something may have manifested within the Unity audio engine to stop the spatial blend parameter from properly working.

    Alternatively, using our native spatializer may never have supported the spatial blend parameter. We do not use that parameter to effect the output signal.

    Are you able to A/B between the two versions of Unity using the same spatializer and hear the difference? That would help us out narrowing where in the code the issue lies (either in our spatializer or in the Unity audio engine).

    I have a message out to Unity about this and to see how it is meant to be handled. I will update this post as soon as I have received info on it.

    Peter G
  • pgiokarispgiokaris Posts: 5
    Hi jlink,

    OK, I received the information from Unity directly. The spatial blend parameter is something that is not handled automatically by the Unity engine, and needs to be handled within our plug-in.

    Although it is not considered a high-pri feature, we will add it to our road-map and make sure we message the audio forum when it's released.

    Best,
    Peter
  • jlinkjlink Posts: 19
    Virtual Boy (or Girl)
    Thanks for the update Peter. Unfortunately rolling back to either 5.5.1 or 5.5.2 isn't very simple for our project, so that isn't something I can do to identify where the spatial blend may have stopped working. I'm glad at least that the feature is on your radar.

    In the mean time, is there a better way to do what we're trying to do? To clarify, we want to have audio that is both spatialized (binaural) as well as 2D so that our musical audio is both local and global in the audio mix.
Sign In or Register to comment.