Voice loop for every client
tavilad
✭
in Photon Voice
Hello,
After joining a PUN room and loading a scene, both the clients that connect to the room hear about 1 second of sound that loops continuously. Does anyone have any idea what might cause this?
After joining a PUN room and loading a scene, both the clients that connect to the room hear about 1 second of sound that loops continuously. Does anyone have any idea what might cause this?
0
Comments
-
Hello,
I am creating a PUN room, after that i am loading a scene on each client. I spawn a character for each client, with a script containing references to Photon Voice Recorder. I only enable the Voice recorder if the Photon View attached to the character is mine. I am also using Factory Audio Source for the voice recorder.
https://pastebin.com/xBJkRBme this is the implementation of the Factory
https://pastebin.com/763iE130 this is the script in which i enable the voice recorder
As i said before, once connected, both clients only head about 1 second of audio that loops.
Hope this explanation helps
0 -
Hi,
In case all works ok when fed with mic audio directly, w/o custom audio source then your AudioRecorder most likely causes this looping. Try to debug or trace it.
The only suspicious thing which caught my eye is Factory assignment. You do it multiple times In Awake of every instance and bind concrete AudioRecorder instance to it. Instead, Factory should be assigned once (e,g, when connecting) and it should return new instance of AudioSource on each call.0 -
Hi vadim, can you be more clear, i dont understand what you mean with the factory assignment. Im still dealing with this issue. Maybe you guys could make a full example using a custom audio source, i cant find one anywhere. Thanks.0
-
I managed to fix this by having a single gameobject with a singleton class that contains the audiorecorder, and in the awake i do the factory assignment.
0 -
The sample of factory assignment can be found in Start() method of TestVoice\Gui.cs0