WebGL and Photon Voice

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

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).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

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

vadim
2019-04-12 10:31:03

This is hardly possible while Unity does not support microphone in WebGL.

PitMouse
2020-04-01 14:28:29

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

JohnTube
2020-04-06 10:00:45

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.

PitMouse
2020-04-11 11:04:55

Cheers @JohnTube fair comment

DontMash
2020-05-13 15:57:23

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

JohnTube
2020-05-14 11:57:34

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.

RickB
2020-05-15 07:30:16

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?

RickB
2020-05-15 07:32:35

The presious post should read "I installed the new version but it still NOT allow me to generate a WebGL ". Thanks.

DontMash
2020-05-15 08:39:01

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?

JohnTube
2020-05-15 12:42:27

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.

cjoverbay
2020-12-20 19:15:18

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?

JohnTube
2020-12-21 10:11:10

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.

Marco123
2021-03-21 02:15:17

@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?

Tobias
2022-06-28 12:13:36

No, nothing new yet.

jayyap
2023-02-02 10:20:21

Hi, how about now? @Tobias

vadim
2023-02-02 16:27:59

We published Voice v2.51 with experimental WebGL support today.

m3huul
2023-02-07 09:52:46

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

Tobias
2023-02-09 14:34:43

For everyone else wondering: Voice 2 is in the Asset Store.

abidaf
2023-03-29 05:05:54

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-29 06:21:15

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