Search Unity

Voice chat in WebGL?

Discussion in 'Web' started by Edvard-D, May 28, 2020.

  1. Edvard-D

    Edvard-D

    Joined:
    Jun 14, 2012
    Posts:
    129
    I've been searching around forbfor a voice chat option for projects that aren't using Photon but haven't had much luck. Is that really all that's available?
     
    Coltonics and TymNetwork like this.
  2. TymNetwork

    TymNetwork

    Joined:
    Jan 16, 2014
    Posts:
    84
    I took the PHOTON Voice 2 Chat from the assetstore and got errors when I changed the build settings to WEBGL.
    Then I also looked for other voicechat using WEBGL and found NONE...
    Still not going to give up, but its a hard task.
     
    berkehanyceylan likes this.
  3. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Unfortunately it does not look like the main page at least at https://assetstore.unity.com/packages/tools/audio/photon-voice-2-130518 would advertise WebGL support.

    The general issue with voice chat in web browsers is that browsers do not have access to UDP networking, which is what voice chat generally uses. This means that existing native plugins cannot be directly recompiled to work in a web browser.

    Web instead has a specification called WebRTC, which governs voice and video communication. For a voice chat application to work well, it should be based on this specification. With a quick search, I find https://assetstore.unity.com/packages/tools/network/webrtc-video-chat-68030, although that is for full video chat. Maybe it could be configured to only do audio (the WebRTC spec treats them similarly). Unfortunately I do not have experience with that asset plugin, and it is commercially priced, so definitely do research around it before deciding on a purchase.
     
    Coltonics likes this.
  4. TymNetwork

    TymNetwork

    Joined:
    Jan 16, 2014
    Posts:
    84
    I used WebRTC for 2 years. For $10 I could talk 1-to-1 for 30 hours a month.
    Each person connected to WEBRTC takes minutes off my allocated 30 hours a month.
    Example ( 4 people take 4 minutes per minute of time all at once) Not worth the cost to extend the time per month.
    FREE WEBRTC would would work for the world...but over $2000 a month is bull$hit....
     
    Coltonics likes this.
  5. Ikaro88

    Ikaro88

    Joined:
    Jun 6, 2016
    Posts:
    300
    I have the exatly same problem, how did you solve?
     
  6. Ikaro88

    Ikaro88

    Joined:
    Jun 6, 2016
    Posts:
    300
    About this i found this:

    https://github.com/Unity-Technologies/com.unity.webrtc

    It can help me?
    Where i can learn more of how to implement it?
     
  7. Bedov

    Bedov

    Joined:
    Oct 28, 2016
    Posts:
    1
    Hi people!

    I know that this is old post, but I'm curios, had someone find the solution to this? Is it possible maybe to have a voice chat parallely working outside the webgl on the same page?
     
  8. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    Photon Voice does not work in WebGL, because it uses Threads, i think.
     
  9. Saaskun

    Saaskun

    Joined:
    Nov 29, 2019
    Posts:
    51
  10. WilliamLeu

    WilliamLeu

    Joined:
    Jul 27, 2012
    Posts:
    19
    :/ I might be able to help whoever to get that PixelEuphoria content to work, but honestly, it's quite jank - and only solves a portion of the entire problem: (efficient) internet streaming and streaming audio playback weren't touched.

    If I REALLY wanted WebGL support and it didn't have to mirror the API of other Unity platforms, an option I would consider would be what Bedov suggested - find a browser solution (a pure Javascript voice chat library - GitHub probably has plenty of free options) and control that JavaScript library from a Unity WebGL plugin, all in the same page.
     
  11. kimvasquez17

    kimvasquez17

    Joined:
    Dec 19, 2017
    Posts:
    22
    post it here if you have a workaround using PixelEuphoria content. I'm still finding a solution for the microphone in webgl