libpeer icon indicating copy to clipboard operation
libpeer copied to clipboard

Getting noise in S16_LE format streaming

Open HaARDIKSD297 opened this issue 8 months ago • 2 comments

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?

HaARDIKSD297 avatar Apr 28 '25 11:04 HaARDIKSD297

参照 peer_connection.c:366 libpeer仅支持pcma/pcmu/opus这三种音频格式,不支持S16_LE。 在浏览器中执行一下命令可以查看支持的音频编码 console.log(RTCRtpReceiver.getCapabilities("audio").codecs);

weiph1029 avatar May 09 '25 08:05 weiph1029

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 []

HaARDIKSD297 avatar May 14 '25 05:05 HaARDIKSD297