If VivoxParticipantTap audio stops streaming after a scene load or player respawn—even when UI indicators appear normal—the connection between Vivox and Unity's audio system may be interrupted. To resolve this, force a reconnection by disabling and then re-enabling the VivoxParticipantTap component in your code after the disruptive event is complete. This re-establishes the audio link and restores the stream.
Scenario:
You are using the VivoxParticipantTap component to route audio from a remote participant to a Unity AudioSource for custom processing or playback. You may notice that the audio stream stops working after certain in-game events, such as loading a new scene, a player dying and respawning, or any other situation where game updates might be temporarily paused.
Symptoms:
- Audio not streaming even though the components appeared to be working correctly after a scene load.
- The Unity
AudioSourcecomponent inspector shows that it is assigned a clip (e.g.,StreamClip0). The audio gauge for theParticipantTapin the inspector shows that it is receiving audio data. - Despite this, remote participant audio is no longer audible.
- The Unity
Cause:
This issue can occur when the connection between the Vivox audio system and the Unity audio system is interrupted. Events like scene loading can heavily occupy the main thread, potentially starving the audio system of updates. This can cause the ParticipantTap to lose its active link to the AudioSource, even if the inspector indicates that the components are still connected.
Resolution:
The solution is to force the ParticipantTap to re-establish its connection with the AudioSource by disabling and then re-enabling the component after the disruptive event has completed.
Follow these steps to resolve the issue:
- Identify the point in your code that executes immediately after a scene has finished loading or a player has respawned.
- In this part of your code, get a reference to the
VivoxParticipantTapcomponent associated with the player's audio. - Disable and then immediately re-enable the component.