Noa Witt
Noa Witt7d ago

How to stop Unity from virtualizing realtime avatar voice?

I have an issue where voice chat is virtualized by unity and then stops working. I was able to kinda solve this by repeatedly reinstantiating the realtime avatar voice chat as a prefab every time it was virtualized, but that led to super choppy and unintelligible chat. My game has a lot of sounds, all of which have a priority of 100 other than voice chat which is attached to an audio source with a priority of 0. Still, Unity constantly virtualizes the voice chat, probably because it’s quiet some times.
Is there a way to fix this WITHOUT rewriting my whole sound system / doing pooling? I don’t use pooling because it over complicates things and I get wonderful performance without it.
14 Replies
kapa.ai
kapa.ai7d ago
Hi @Noa Witt. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources do not contain explicit information about preventing Unity from virtualizing the AudioSource used by Normcore's RealtimeAvatarVoice, or specific settings to ensure voice chat is never virtualized by Unity's audio system. However, the documentation does confirm that RealtimeAvatarVoice uses a Unity AudioSource for playback, and you can provide your own AudioSource component for custom settings, including spatialization and (by implication) priority settings. If you add your own AudioSource to the prefab, RealtimeAvatarVoice will use it instead of creating one at runtime. This allows you to configure properties like priority directly in the editor, which you are already doing by setting the priority to 0 (highest priority in Unity) Voice Chat Reference. The documentation does not mention any Normcore-specific workaround for Unity's audio virtualization behavior. It also does not provide a method to force the AudioSource to remain unvirtualized beyond standard Unity settings. If Unity is still virtualizing the voice chat AudioSource despite the priority setting, this is likely due to Unity's internal audio management (e.g., too many AudioSources playing, or the source being considered inaudible). The Normcore docs do not provide a built-in solution for this scenario. Summary:
- You are already using the recommended approach by setting AudioSource priority to 0. - You can provide your own AudioSource for further customization. - There is no Normcore-specific setting to prevent Unity from virtualizing the voice chat AudioSource. - The knowledge sources do not mention any solution that avoids pooling or rewriting your sound system. If you need more control, you may need to look into Unity's audio system documentation or consider alternative audio management strategies outside of what Normcore provides. If you have further questions, the Normcore team encourages reaching out on their Discord for community or developer support. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai7d ago
<@444173592205459466> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
maxweisel
maxweisel7d ago
what do you mean virtualized? oh you mean the audio source stops playing fwiw Unity has no idea of the volume level. We use OnAudioFilterRead to replace a constant stream of audio frames either a value of 1 with actual audio data. Unity will believe it has a constant stream of audio at max volume out of the AudioSource before fx are run. Priority is the right thing to look at. Is it possible you have something else with a 0 priority knocking it out? or a very low max voice count? fwiw, I don’t think pooling will solve this either?
Noa Witt
Noa WittOP7d ago
I have no other objects at 0 and I have the highest max voice counts for both real voices and virtualized It’s still so odd, the voice chat will randomly cut out and stop permanently for a person Or not work at all This is a problem that has persisted over multiple projects with fresh starts and installs There’s only one realtime voice component in each network player as well
maxweisel
maxweisel7d ago
what version of Normcore are you on? a few weeks ago we shipped a bug fix for RealtimeAvatarVoice that may be causing what you’re seeing: https://discord.com/channels/393839515074297858/852911447784947723/1435378164158169088
Noa Witt
Noa WittOP7d ago
I'm on version 2.16.2
maxweisel
maxweisel7d ago
Try 2.17.3 for me
Noa Witt
Noa WittOP3d ago
Will do! It's working better now, but it works for like one minute then randomly stops? Has this happened for anyone else with voice chat? I just reinstalled everything with the newest version
maxweisel
maxweisel3d ago
I've seen voice chat culling stop audio for folks, but I having voice chat be top priority has always fixed it I'm not sure what's happening here.
Noa Witt
Noa WittOP3d ago
It's extremely weird and concerning It's also happened my last two games Which is odd
maxweisel
maxweisel3d ago
is there a 3rd party package you’ve used in them that touches audio sources?
Noa Witt
Noa WittOP3d ago
Meta XR Audio That's it, I use their spatializer as well
maxweisel
maxweisel3d ago
I will say, Meta has a way with breaking things constantly in all of their packages lol. I haven’t used their audio packages though so I’m not sure if that’s the issue I also know Unity’s native spatializer API has introduced bugs with updates. Resonance Audio has similar issues because it was never updated to use the latest version of Unity’s spatializer API could be worth trying with that removed
Noa Witt
Noa WittOP3d ago
You're probably right about that... now that I think of it thats when things stopped working

Did you find this page helpful?