Sharing System Audio via Photon Voice?

SW95
SW95
edited March 2 in Photon Voice

Hello,

I'm trying to implement something like screen streaming in the Unity.

Whenever player starts playing any audio in his device(video,music etc.) I would like to stream it to the others. As I know, I somehow need to switch audio source of Photon Voice to the system audio or something like Streo Mix of the PC, would it be possible?


Thanks!

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭

    Hi @SW95,

    You can start here, see pastebin of component used to get audio from AudioSource.

    replace AudioSource with AudioListener to get all audio being played by Unity.

    don't forget to remove the line:

        Array.Clear(frame, 0, frame.Length);

    I hope this helps, I might have time to commit some of this in a GitHub repo later.

    but you might end up having echo if you also listen to others transmitting their own audio, try adding WebRtcAudioDsp + AEC enabled next to Recorder to reduce this.