How to save the whole conversation?

in Photon Voice
Greetings,
I'm using Photon Voice and want to record every user's voice in the room on one client's end, and I found this documenton the official website. But I can't find any of them in any namespace or class, and WebRtcAudioDsp.cs doesn't exist. So my question is how to use it?
For reference, the Unity version I'm using is 2019.4.11, and Photon Voice is 2.22.2.
Thanks in advance!
I'm using Photon Voice and want to record every user's voice in the room on one client's end, and I found this documenton the official website. But I can't find any of them in any namespace or class, and WebRtcAudioDsp.cs doesn't exist. So my question is how to use it?
For reference, the Unity version I'm using is 2019.4.11, and Photon Voice is 2.22.2.
Thanks in advance!
0
Comments
Check out these two utility scripts available in the package:
- "Assets\Photon\PhotonVoice\Code\UtilityScripts\SaveIncomingStreamToFile.cs": attach it to the same GameObject as the VoiceConnection or PhotonVoiceNetwork component.
- "Assets\Photon\PhotonVoice\Code\UtilityScripts\SaveOutgoingStreamToFile.cs": attach it to the same GameObject as the Recorder component.
Files will be saved under Application.persistentDataPath.
They follow the same logic as what's explained in the documentation you have linked.
The WebRtcAudioDsp class is available in the Photon.Voice.Unity namespace.
The file is located at this path: "Assets\Photon\PhotonVoice\Code\WebRtcAudioDsp.cs".
1. I'm following this settings for my voice manager object. Namely, PhotonVoiceNetwork and Recorder are both attached to the voice manager, so I attach SaveIncomingStreamToFile.cs and SaveOutgoingStreamToFile.cs to the same gameobject. But when I run the project myself (only one person in the room), I found two recorded .wav files. One of them is correct, yet the other is always blank (44 bytes).
My project has a lobby and a room. Each player enters the lobby first, and then jump into the room.
So I tried turning on and off the toggle "Don't Destroy on Load" on Photon Voice Network component, but it doesn't make any difference. How should I fix this issue?
2. How do I get the PlayerId for each player's voice, except modifying the "SaveOutgoingStreamToFIle.cs" script directly?
2. Yes you can make your own custom class inspired from that script and get actor number from PhotonVoiceNetwork.Instance.Client.LocalPlayer.ActorNumber. You could also add more metadata if you want.
PhotonVoiceNetwork.Instance.Client.LocalPlayer.ActorNumber is the same as photonView.Owner.ActorNumber locally (photonView.Owner.IsLocal).
RemoteVoiceLink.PlayerId is the same as actor number and not the VoiceId.
The VoiceId is a number assigned to the voice stream to identify it, since you could use more than one Recorder to have more than one outgoing streams (up to 255).
In most cases, you don't need to touch this.