Voice loop for every client


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?


  • Hi @tavilad,

    Thank you for choosing Photon!

    What is the Photon Voice you are using? latest 1.15?
    Did you try the demos?

    Can you repeat reproduction steps with more details or try to better describe what you are reporting?
    Maybe a short video?
  • 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

  • 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.
  • 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.
  • 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.
  • The sample of factory assignment can be found in Start() method of TestVoice\Gui.cs