我一直在做一个近实时的语音聊天应用程序。该网页将把数据包发送到服务器,服务器会将数据包保存到磁盘,然后将数据包重新传输到其他连接的网页。我尝试了许多其他解决方案,但是它们要么太迟钝,要么不玩。我已经意识到发送PCM样本将是最佳选择(服务器也将记录这些样本),但是我不确定如何使它们在另一个客户端播放。我正在使用NodeJS和Socket.IO。提前致谢!
最佳答案
The webpage will send packets to the server, and the server will save the packets to disk, and then re transmit the packets to the other connected webpages.
已经不是那么有效了。最好是在对等方之间直接发送数据。
I've realized that sending PCM samples would be optimal
不,不会。这需要更多的带宽,这将需要更好的缓冲,这意味着更高的延迟。这是语音聊天...无需使用像PCM这样的无损编码。
I've been working on making a near real-time voice chat app.
这基本上是WebRTC构建的事实上的主要用例。如果使用WebRTC,则会得到:
换句话说,这已经是WebRTC解决的问题。
关于html - 发送和接收PCM样本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61922547/