libpeer
libpeer copied to clipboard
Getting noise in S16_LE format streaming
I'm running a WEBRTC application on the NXP IMX8 and using the index.html file from https://github.com/sepfy/sepfy.github.io/tree/main/webrtc. When I send a test audio file in A-LAW format, it works fine. However, when I send an audio file in S16_LE format, I get noise instead of proper audio. How can I properly play an S16_LE format audio file?
参照 peer_connection.c:366 libpeer仅支持pcma/pcmu/opus这三种音频格式,不支持S16_LE。
在浏览器中执行一下命令可以查看支持的音频编码
console.log(RTCRtpReceiver.getCapabilities("audio").codecs);
console.log(RTCRtpReceiver.getCapabilities("audio").codecs);
Array(5) [ {…}, {…}, {…}, {…}, {…} ]
0: Object { channels: 2, clockRate: 48000, mimeType: "audio/opus", … }
1: Object { channels: 1, clockRate: 8000, mimeType: "audio/G722" }
2: Object { channels: 1, clockRate: 8000, mimeType: "audio/PCMU" }
3: Object { channels: 1, clockRate: 8000, mimeType: "audio/PCMA" }
4: Object { channels: 1, clockRate: 8000, mimeType: "audio/telephone-event", … }
length: 5
<prototype>: Array []