alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.36k stars 1.04k forks source link

Is there an example of a Java client connecting to the webRtc server #1544

Closed xubinlu closed 3 months ago

xubinlu commented 3 months ago

1、I haven't used WebRtc before. We are an Android application. Have anyone else implemented an example of using WebRtc to connect to a server from an Android application before 2、Can multiple client connections be supported simultaneously if using the webRtc server?

nshmyrev commented 3 months ago
  1. Something like this probably

https://webrtc.github.io/webrtc-org/native-code/android/

  1. Yes
xubinlu commented 3 months ago
  1. Something like this probably

https://webrtc.github.io/webrtc-org/native-code/android/ thanks, I have seen this before, but after reading it, I still don't know how to write it. Unlike webSocket, which has Java client code examples, I am very clear about how to do it after reading it

xubinlu commented 3 months ago

I still have some questions. What is the address when connecting to the webRtc server in android? I know that the address in the browser is https://SERVER_IP:2700/

nshmyrev commented 3 months ago

You need to setup a forward from ssl-configured nginx to localhost:2700, in android you use external nginx url. You also have to open udp ports fro connection

xubinlu commented 3 months ago

When I was looking at other examples of webRtc used in android, I found that I need to use webSocket to connect to an address, and then use webRtc. Is the “external nginx url” the address to use webSocket to connect to?

nshmyrev commented 3 months ago

Offer comes with simple http post, not websocket. Yes post goes to external address.