Voice 2.31 - errors with Unity WebGL

Unity 2022.1.5f1

Photon Voice 2.31 from Asset Store.

I'm getting a bunch of errors when trying to build on WebGL.

After putting in hacks to get the compiler errors ignored, I'm getting linker errors with undefined symbols.

Errors:

Assets\Photon\PhotonVoice\PhotonVoiceApi\Core\Platform.cs(52,30): error CS0234: The type or namespace name 'WebAudioMicIn' does not exist in the namespace 'Photon.Voice.Unity' (are you missing an assembly reference?)


Assets\Photon\PhotonVoice\Demos\DemoVoiceUI\Scripts\MicrophoneDropdownFiller.cs(108,30): error CS0103: The name 'Microphone' does not exist in the current context


Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js: undefined symbol: opus_decode (referenced by top-level compiled C/C++ code)


See attached sshots


Comments

  • Tobias
    Tobias admin

    WebGL is not supported by Photon Voice 2 (as of v2.31).

  • @Tobias We are facing the same problem. Any idea when Photon will be using WebRTC for WebGL support?

    Any help is appreciated.

  • Tobias
    Tobias admin

    We don't have an ETA for this, sorry.

  • Hi @Tobias,

    Thank you for your response.

    We are working on a cross-platform project, that incorporates Photon Voice. We use Voice on the other platforms.

    While we would prefer to have full support of Photon Voice on WebGL, I understand that WebGL is a difficult platform to support.

    Since our project uses Photon Voice for our other platforms, it would be really convenient if, even though it isn't supported on WebGL, it would at least build under WebGL.

    We have incorporated hacks to OpusWrapper.cs and other places to disable Photon Voice under WebGL so we can build properly. But we would prefer an official solution.

    I understand that you can't give an ETA for full WebGL support, but could you at least ensure that your product builds properly when incorporated into a project that has to support WebGL (even if it's disabled and/or reduced functionality)?

    Thanks

  • Tobias
    Tobias admin

    Yes, ok, that makes sense. I thought, that (working export, maybe with a logged warning) is covered by Photon Voice.

    We'll look into this.

  • Hello all,


    I am having the exact same problem right now, any updates for this? Thanks!

  • Add more background: So we are also making a Cross-platform project. Thus, it will be super handy if we could just disable photon voice package #if UNITY_WEBGL. I have tried several times but could not found a proper way to do so. Any suggestions?

  • We already put some effort in making Voice WebGL compatible. E,g. UnityMicrophone wrapper around Unity Microphone API is an abstraction which compiles on all platforms including WebGL. So maybe we just missed something. What exact errors do you have ?

    We will test the next release for WebGL compatibility.

    The simplest solution is to disable entire Photon Voice assembly for WebGL via conditional compilation symbol: https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html#conditional-assembly