简体   繁体   English

HTML5音频浏览器无法解码使用IMA ADPCM编码的WAV文件

[英]HTML5 audio Browsers unable to decode wav file encoded with IMA ADPCM

First, I apologize as I'm essentially new to working with audio. 首先,我很抱歉,因为我本质上不熟悉音频。

The web application I currently work on, designed using asp.net/vb.net, allows users to record and play back audio using the Nanogong applet ( http://nanogong.ust.hk/doc_faq.html ). 我目前使用的Web应用程序是使用asp.net/vb.net设计的,它允许用户使用Nanogong小程序( http://nanogong.ust.hk/doc_faq.html )录制和播放音频。 We are shifting over to HTML5 audio as support for the NPAPI plugin has been removed from most browsers (except Firefox until the end of this year). 我们正在转向HTML5音频,因为大多数浏览器(到今年年底为止,Firefox除外)已删除了对NPAPI插件的支持。

Nanogong uses 4-bit IMA ADPCM to encode wav files. Nanogong使用4位IMA ADPCM编码wav文件。 I'm able to convert the Nanogong wav file into 16-bit PCM using sox, and then using that wav file create an ogg version using oggenc2 and an mp3 version using lame. 我可以使用sox将Nanogong wav文件转换为16位PCM,然后使用该wav文件使用oggenc2创建一个ogg版本,并使用lame创建一个mp3版本。 We need the ogg files for Firefox and Chrome, and the mp3 for Safari. 我们需要用于Firefox和Chrome的ogg文件,以及用于Safari的mp3。

What I would like to learn is why browsers do not seem to be able to play the 4-bit IMA ADPCM format? 我想学习的是为什么浏览器似乎无法播放4位IMA ADPCM格式? Can they only play PCM format in 8-bit or 16-bit? 他们只能播放8位或16位的PCM格式吗? In Firefox, firebug indicates the IMA ADPCM wav file cannot be decoded; 在Firefox中,firebug表示无法对IMA ADPCM wav文件进行解码; Chrome and Opera don't mention anything in the developer console, but I'm guessing it's the same as Firefox since the file won't play in those browsers. Chrome和Opera并未在开发人员控制台中提及任何内容,但我猜它与Firefox相同,因为该文件无法在这些浏览器中播放。

I've tried searching the web but there doesn't seem to be a whole lot about HTML5 audio, or most of it seems to be older information. 我已经尝试过搜索网络,但是关于HTML5音频的内容似乎并不多,或者大多数似乎都是较旧的信息。 I also see more articles about converting from PCM to ADPCM. 我还看到了更多有关从PCM转换为ADPCM的文章。

Any guidance or resources would be greatly appreciated. 任何指导或资源将不胜感激。 Thanks!! 谢谢!!

Browser vendors are not required to support any particular audio format. 浏览器供应商不需要支持任何特定的音频格式。 There are issues such as licensing, although perhaps not so relevant in this case, which make vendors only support the most basic (such as uncompressed PCM) and common formats (MP3, OGG etc.), and in some cases would rely on the underlying system to decode audio (or video). 存在诸如许可之类的问题,尽管在这种情况下可能不那么相关,这使得供应商仅支持最基本的(例如未压缩的PCM)和通用格式(MP3,OGG等),并且在某些情况下将依赖于基础解码音频(或视频)的系统。 Size of code base relative to gain could be another factor. 相对于增益的代码库大小可能是另一个因素。

4-bit IMA ADPCM would fall into the category "not so common" as of today which is likely why there is no support to find in the browsers. 到目前为止,4位IMA ADPCM属于“不太常见”类别,这很可能就是为什么在浏览器中找不到支持的原因。

It's possible to get around this though by supporting the format manually using Audio API (which eliminates IE) and binary parsing/decoding. 尽管可以通过使用音频API(消除了IE)和二进制解析/解码手动支持格式来解决此问题。 I am doing this is my audio-reader-js library but currently I have no support for IMA encoded data. 我正在做这是我的audio-reader-js库,但是目前我不支持IMA编码数据。 It can be used as a basis though to implement support for this as well. 它也可以用作实现此目的的基础。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM