UDP packet-size/latency tradeoff when streaming audio?

大兔子大兔子 提交于 2019-12-04 19:08:11
Brad

You will most definitely be buffering more than 5ms. 5ms is an extremely low buffer, even for the playback sound card itself. Only sound devices with special drivers (such as ASIO) are able to get that low, and that is about as low as they go. Are you sending those packets over your own LAN where you can control and prioritize delivery? That is the only way to really guarantee performance. There are layer 2 protocols built specifically for this, such as Ethersound. It depends on what you are building and what your requirements are.

A common buffer size for network software is around 1400-1500 bytes, which is near the maximum that you can send per packet over a typical Ethernet network. This is what I recommend for your application.

I would recommend you use up to 534 bytes. That's the limit if you want to avoid fragmentation and therefore possible data loss on that ground.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!