WebGL and Photon Voice
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Voice.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
WebGL and Photon Voice
Ishwar
2019-04-09 03:24:07
Is there any plan for WebGL support? I understand that the voice related functionality needs threading that needs local resources access. Would be wonderful to get this WebGL supported. I have a need where game can not be installed on local machine.
Comments
This is hardly possible while Unity does not support microphone in WebGL.
Do you think Photon Voice could tie together with a 3rd part webGL microphone asset like this? -https://assetstore.unity.com/packages/tools/input-management/microphone-webgl-library-79989
Hi @Ishwar, @PitMouse,
It was decided that Photon Voice will not support WebGL.
Our plans are to use WebRTC in the future but we have no schedule.
You could, try to make that asset work with Photon Voice but we have not tried it and don't have experience with it.
Thank you for your understanding and patience.
Cheers @JohnTube fair comment
Might be a bit late but I have made that asset work as a audio-clip source for the Photon Voice Recorder. My problem with this use case though is that the voice connection process stops at ClientState ConnectingToNameServer. I have not touched any of the scripts concerning Photon Voice.
@JohnTube May you know what the reason for this behaviour is?
Best regards
Hi @DontMash,
Thank you for choosing Photon!
Switch protocol to WebSocketsSecure (WSS) in WebGL.
Photon clients use WebSocketsSecure protocol when connecting to Photon Cloud in Unity / WebGL.
So WSS is needed.
Update to the latest Photon Voice 2 (2.16.1 as of now).
I mentioned the update to 2.16.1 because in older version we did not allow using a protocol other than UDP for connecting to Photon Cloud using a Photon Voice client.
Now we do allow it and log a warning.
I installed the new version but it still does allow me to generate a WebGL version complaining about the Microphone does not exist coming from the MicWrapper.cs file. Was this version was supposed to fix with the WebSocketsSecure selected?
The presious post should read "I installed the new version but it still NOT allow me to generate a WebGL ". Thanks.
I looked into it but I can't seem to get hang of it.
Where and how do I have to change the protocol?
Is this Unity or Photon specific?
I've tried this:
PhotonNetwork.NetworkingClient.LoadBalancingPeer.TransportProtocol = ConnectionProtocol.WebSocketSecure;
PhotonVoiceNetwork.Instance.Client.LoadBalancingPeer.TransportProtocol = ConnectionProtocol.WebSocketSecure;
Both do not to the trick.
@JohnTube may you help me again and specify your last answer?
Hi @RickB,
Thank you for choosing Photon!
As mentioned on the documentation here, WebGL is not supported.
I was giving some pointers and hints (not tested, not recommended) for users who want to test adding microphone feed to Photon Voice.
Photon clients use WebSocketSecure protocol when connecting to Photon Cloud in Unity / WebGL.
So WSS is needed.
I mentioned the update to 2.16.1 because in older version we did not allow using a protocol other than UDP for connecting to Photon Cloud using a Photon Voice client.
Now we do allow it and log a warning.
Hi @DontMash,
If use PUN settings from PhotonVoiceNetwork then you should set the protocol in PhotonServerSettings.
PUN automatically switches to WSS in WebGL, maybe we will do the same for Voice in the next updates although WebGL is not technically supported.
if you do not use PUN settings then set the protocol in PhotonVoiceNetwork.Settings (or VoiceConnection.Settings).
Increase the log level for Voice components and check the logs.
Hello!
Also would love this feature. I am trying to get this working with some of the plugins described.
I noticed there is this solution by Frostweep - https://github.com/frostweep/PUN2VoiceWebGLUnity
Are you all planning on working on this for the plugin? Would be awesome to have a plug and play solution.
If one of us gets it working would you consider incorporating it in the plugin?
Hi @cjoverbay,
Thank you for choosing Photon!
Well if you find a solution that works on WebGL for Photon Voice then you don't really need us to include it in the package as we would have to support it officially and guarantee it won't break with each update etc.
So I don't think we are considering this.
@cjoverbay wrote: »
Hello!
Also would love this feature. I am trying to get this working with some of the plugins described.
I noticed there is this solution by Frostweep - https://github.com/frostweep/PUN2VoiceWebGLUnity
Are you all planning on working on this for the plugin? Would be awesome to have a plug and play solution.
If one of us gets it working would you consider incorporating it in the plugin?
Did you tried that SDK?
It works also with oculus quest 2?
abdnadeem382
2022-06-28 08:00:16
@JohnTube Any updates on photon voice for WebGL?
No, nothing new yet.
Hi, how about now? @Tobias
We published Voice v2.51 with experimental WebGL support today.
vadim 2023-02-02T16:27:59+00:00
We published Voice v2.51 with experimental WebGL support today.
where can I get the 2.51 version package
EDIT: nvm I'm dumb, found it
For everyone else wondering: Voice 2 is in the Asset Store.
Hi, I've tested Photon Voice v2.51 on Unity 2021.3.16 using DemoVoiceMinimal demo scene on WebGL. Microphone type is using Photon. I put the build on https server, it ran without subtle errors on Edge/Chrome browser but no audio is heard. However, when I turn on Debug Echo option, my voice is echoed successfully. As a note, voice chat is working in the editor and on the windows desktop build version. What am I missing here? Are there any specific webserver settings for Photon Voice to work on WebGL? Please advise, thanks.
abidaf 2023-03-29T05:05:54+00:00
Hi, I've tested Photon Voice v2.51 on Unity 2021.3.16 using DemoVoiceMinimal demo scene on WebGL. Microphone type is using Photon. I put the build on https server, it ran without subtle errors on Edge/Chrome browser but no audio is heard. However, when I turn on Debug Echo option, my voice is echoed successfully. As a note, voice chat is working in the editor and on the windows desktop build version. What am I missing here? Are there any specific webserver settings for Photon Voice to work on WebGL? Please advise, thanks.
I managed to get Audio Chat working in WebGL by changing the Protocol entry in Voice App Settings from 'Udp' to 'Web Socket Secure'. I realized this after reading this thread link mentioning that WebGL only support Web Socket Secure protocol. https://forum.photonengine.com/discussion/bookmark/14088/ioCQyAMZgkDauIWV?Target=discussion%2F14088%2Fusing-photon-voice-in-webgl-for-receiving-audio-only-no-microphone
Back to top