How to initialize Recorder ? Photon Voice

sunil
✭
"Recorder require initialization, Call recorder.init(VoiceClient, object)"
How can i initialize recorder ?
https://doc.photonengine.com/en-us/voice/current/getting-started/recorder#initialization
in this section it is not properly mentioned.
How can i initialize recorder ?
https://doc.photonengine.com/en-us/voice/current/getting-started/recorder#initialization
in this section it is not properly mentioned.
0
Best Answers
-
Hi @sunil,
Thank you for choosing Photon!
How are you using Photon Voice 2? with or without PUN 2?
Do you follow the flows we recommend here or here?
When using Photon Voice 2 with PUN 2 following the suggested flow, you do not need to manually/explicitly initialize the recorder(s). It's done implicitly automatically.
In any case, as the documentation suggests you need at least a VoiceClient object to initialize a Recorder.
So the VoiceClient can be found in the VoiceConnection (or PhotonVoiceNetwork) component.recorder.Init(voiceConnection.VoiceClient, customObjectIfAny);
5 -
Thanks !!😊
I am using Photon Voice 2 with PUN 2.
i follow the flows here
The problem has been solved.recorder.Init(voiceConnection.VoiceClient, customObjectIfAny);
this method automatically called when you instantiate player usingPhotonNetwork.Instantiate("prefab_Name");
and it must have PhotonView component attached to it but in my project i was creating lobby player using unityInstantiate(prefab);
, so i changed itPhotonNetwork.Instantiate("prefab_Name");
and, it worked .😁0
Answers
-
Hi @sunil,
Thank you for choosing Photon!
How are you using Photon Voice 2? with or without PUN 2?
Do you follow the flows we recommend here or here?
When using Photon Voice 2 with PUN 2 following the suggested flow, you do not need to manually/explicitly initialize the recorder(s). It's done implicitly automatically.
In any case, as the documentation suggests you need at least a VoiceClient object to initialize a Recorder.
So the VoiceClient can be found in the VoiceConnection (or PhotonVoiceNetwork) component.recorder.Init(voiceConnection.VoiceClient, customObjectIfAny);
5 -
Thanks !!😊
I am using Photon Voice 2 with PUN 2.
i follow the flows here
The problem has been solved.recorder.Init(voiceConnection.VoiceClient, customObjectIfAny);
this method automatically called when you instantiate player usingPhotonNetwork.Instantiate("prefab_Name");
and it must have PhotonView component attached to it but in my project i was creating lobby player using unityInstantiate(prefab);
, so i changed itPhotonNetwork.Instantiate("prefab_Name");
and, it worked .😁0 -
When I follow the PUN2 flow. I get this message "[PhotonVoice.PhotonVoiceNetwork] 2020-09-19T11:12:28:An instance of PhotonVoiceNetwork is already set. Destroying extra instance.
UnityEngine.Debug:LogErrorFormat(Object, String, Object[])"
I have made a gameobject and attached the PhotonVoiceNetwork to it. Also attached recorder and followed the instructions.
I attached a Photon Voice View and Speaker to a prefab character.
When I run in unity I get the above message.0