Photon Voice brief warning to anyone using it, to ensure you do not waste time with the setup!

So this being my 2nd time trying to setup Photon Voice Recorder, I've finally figured out what I've done wrong.

My issue was that with the photon voice recorder would never transmit any sound at all, no matter what I did, if I were to copy the settings for the audio source object, change the voice settings to every option.

In the end it was very simple, and maybe something that is put on the Photon Voice Documentation website, just to stop people from wasting as much time as I did.

Make sure the Photon Voice Recorder is initially disabled, then enable it after either a slight delay or manually. I guess this ensures that it is setup correctly, I have debug logs that print out the transmit peak and average volumes, and if it was initially enabled it just never worked.

Comments

  • JohnTubeJohnTube mod
    edited July 19
    Hi @f03n1x,

    Thank you for choosing Photon and for your contribution in the forum!
    Please keep helping others out and being a positive member of the community.
    maybe something that is put on the Photon Voice Documentation website
    Of course we welcome your suggestions. Only with your feedback, the documentation can get better.
    just to stop people from wasting as much time as I did.

    I'm sorry that you feel that your time has been wasted or any other inconvenience you had with Photon Voice.
    Make sure the Photon Voice Recorder is initially disabled, then enable it after either a slight delay or manually.
    I think you are trying to make PhotonVoiceRecorder (or Speaker) work from within the scene as opposed to the use case we support and we have on the documentation and expose in the demos: which is the "Voice Prefab": instantiating the Recorder and the Speaker at runtime.
    Is that it?
    If it's not the case, can you reproduce this with the demo scenes or TestVoice scene?
    how can we reproduce? the shortest list of steps or minimal reproduction project are required.
    if I were to copy the settings for the audio source object

    The PhotonVoiceRecorder is not related to the AudioSource component. The PhotonVoiceSpeaker is.
    change the voice settings to every option.
    If you mean that updating PhotonVoiceSettings does not have any effect at runtime to a PhotonVoiceReocrder currently transmitting, then yes, we were aware of this and should be fixed in latest version v1.16. See this discussion here.
  • f03n1xf03n1x
    edited July 19
    I attached the voice speaker and recorder to my player prefab that gets created when the scene is instantiated, it was setup to be enabled at the start but that seemed to not have worked. This was the only real difference to the prefab for the voice demo scene, that the voice recorder was initially disabled.

    There really isn't much in terms of steps for reproducing this error, but I can at least note down what I tried:
    1. I initially started with a player prefab that is setup already to be used with photon, it has photon views, multiple components, multiple child objects, etc
    2. I followed the steps here: https://doc.photonengine.com/en-us/voice/current/getting-started/voice-for-pun that is by adding in the photon voice recorder script to my player prefab, it added it's required components, since I already have a photon view, it attached the photon speaker and audio source.
    3. For our game this prefab is setup in the scene, but it's only done so that we can apply changes that need to be done to the prefab itself, we also have an object that manages network behavior, that instantiates the player from within the project view.
    4. Start the scene, for our game we login an account and load the main scene, which the player is set to initially create a solo room.
    A couple notes about the tests I did before hand, like the zombunny prefab, I attached something that would be visibly shown when the microphone was detected, I did a simpler method, by having a cube attached and setting the mesh renderer to be disabled if the microphone had not detected any sound, along with that I did a more crude approach and used debug printouts of all information I could find out about the photon voice recorder.

    https://imgur.com/a/CfmamNI

    https://imgur.com/a/1v89fTV I've attached a link to an image of the zombunny prefab (not sure how to attach an image), and how the voice recorder script is set to disabled as default. Had I known earlier I wouldn't have wasted time trying other settings.

    Well I tested the previous version and updated to the newest version last night, but despite the update, the one thing I didn't try was setting the voice recorder component to be initially disabled, so I guess it could have been a combination of the two.

    I also mentioned the audio source settings, because by default when an audio source is created unity has preset values that are a bit different to that of the zombunny prefab (spatial blend is set to 1 (default unity is set to 0) for the prefab, along with volume rolloff using linear not the default logarithmic rolloff, I wasn't exactly sure if that made a difference, but just to be on the safe side I tried all differences I could find).

    At the end of the day, it works I don't mind too much that I spent all the time getting it to work since in all that time I learnt more about photon, then if it worked straight away, which is a lot more beneficial to me :D
  • For our game this prefab is setup in the scene
    So the issue happens with the prefab instance already on the scene at compile/edit time? If so then this is expected as we do not support that use case. But how does the PhotonView work?
  • It's never used though, it is only really a convenience to have it already added to the scene to have it be ready for changes, the network manager object that we have setup uses the prefab stored in our project files. The one in the scene already is disabled and never loaded up at runtime, sorry if I didn't make that clear enough.

    It is honestly the same as dragging a prefab into a scene to do changes, then after hitting apply removing the prefab from the scene.
Sign In or Register to comment.