How to initialize Recorder ? Photon Voice

sunil
sunil
edited September 2019 in Photon Voice
"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.

Best Answers

  • sunil
    sunil
    edited September 2019 Answer ✓
    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 using PhotonNetwork.Instantiate("prefab_Name"); and it must have PhotonView component attached to it but in my project i was creating lobby player using unity Instantiate(prefab);, so i changed it PhotonNetwork.Instantiate("prefab_Name"); and, it worked .😁

Answers

  • sunil
    sunil
    edited September 2019 Answer ✓
    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 using PhotonNetwork.Instantiate("prefab_Name"); and it must have PhotonView component attached to it but in my project i was creating lobby player using unity Instantiate(prefab);, so i changed it PhotonNetwork.Instantiate("prefab_Name"); and, it worked .😁
  • 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.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @RPhoton,

    Search your scenes' hierarchy for "t:PhotonVoiceView" and make sure you have only one instance at any given time, also make sure the prefab does not have any.
    The error message means you have more than one PhotonVoiceView.