xqq / mpegts.js

HTML5 MPEG2-TS / FLV Stream Player
Apache License 2.0
1.67k stars 211 forks source link

目前音频格式只能支持aac和mp3,有办法能支持pcma音频吗? #189

Open alun0829 opened 4 months ago

alun0829 commented 4 months ago

大神你好,查看源码时发现目前音频格式只能支持aac和mp3,有办法能支持pcma音频吗? 自己参考以前的flv.js加了个soundFormat === 7的分支,但是在收到pcma音频数据后,不知道应该如何处理,直接track.samples.push()不行。感觉是不是应该要先重采样成PCM音频?

大神有没有什么解决思路,非常感谢

alun0829 commented 4 months ago

发一个测试flv文件 [Uploading 阿凡达_pcma.tar.gz…]()

bosscheng commented 3 months ago

fmp4标准是不支持pcma格式的。

alun0829 commented 3 months ago

fmp4标准是不支持pcma格式的。

大神您好,不支持pcma,但是pcm应该是可以的吧,我先转换成pcm,然后再播放是否可行?

bosscheng commented 3 months ago

@alun0829 不行,因为fmp4标准也不支持pcm,pcm 你可以通过audioContext进行播放。