adrenak / univoice

Voice chat/VoIP solution for unity.
http://www.vatsalambastha.com/univoice
MIT License
363 stars 36 forks source link

How can I Set Turn Server in univoice ? #27

Closed mesismart closed 10 months ago

mesismart commented 12 months ago

I had Problem for Connecting Device With difference Network . for solve that I have Ice serve .but i don't know how to add this setup . my ice server Config is like this : const configuration = { 'iceServers': [{ urls: "stun:stun.relay.metered.ca:80", }, { urls: "turn:a.relay.metered.ca:80", username: "f6354f6eae6993753c1c1b9a", credential: "RseLoSxMBSjDjNBs", }, { urls: "turn:a.relay.metered.ca:80?transport=tcp", username: "f6354f6eae6993753c1c1b9a", credential: "RseLoSxMBSjDjNBs", }, { urls: "turn:a.relay.metered.ca:443", username: "f6354f6eae6993753c1c1b9a", credential: "RseLoSxMBSjDjNBs", }, { urls: "turn:a.relay.metered.ca:443?transport=tcp", username: "f6354f6eae6993753c1c1b9a", credential: "RseLoSxMBSjDjNBs", } ] }; const peerConn = new RTCPeerConnection(configuration);

how can Init that for new ChatRoomAgent

    void InitializeAgent()
    {
        agent = new ChatroomAgent(
                  new UniVoiceAirPeerNetwork("ws://24.199.109.229:12776"),
               new UniVoiceUniMicInput(0, 16000, 100),
            new UniVoiceAudioSourceOutput.Factory()
        );
zeroone-ved commented 12 months ago

UniVoiceAirPeerNetwork has a second parameter for iceServers, but there's no place to input the username and the credential.

adrenak commented 10 months ago

Hi @mesismart !

I'll see what I can do in the univoice airpeer implementation.

But even if you get the Airpeer based solution to work, it may not be the right networking plugin for webrtc. In fact I'm thinking of archiving it, or putting up a disclaimer about its problems. For more info see the issues on the airpeer github repo.

I'd suggest looking into com.unity.webrtc as they offer a lot more capabilities. If all you need it P2P voice chat, they even have ready to use voice chat samples.

If you need a framework that's networking agnostic, you would have to make a Unity webrtc based Univoice networking implementation or wait for a while for me or someone else to support it which could take a couple months.