NAudio error: “NoDriver calling acmFormatSuggest”

余生颓废 提交于 2019-11-29 06:58:30

Running Windows 2008 R2, using Naudio to detect the length of Wav and Mp3 files, i ran into the same problem.

I solved this by following this: https://technet.microsoft.com/en-us/library/cc772567.aspx

Essentially, install the "Desktop Experience" feature.

The above will require a restart of the server.

Once the above was installed, i needed to enable nothing further, the problem was resolved.

WaveFormatConversionStream makes use of the ACM codecs installed on your machine. It starts by asking if there is any ACM codec installed that can convert from the source to the target format. It would seem that you are missing an MP3 codec on the target machine.

NAudio does offer a different way to decode MP3s, using the DMO MP3 Decoder (DirectX Media Object), which may also be on your target machine. To use this you need to get the latest NAudio source from Codeplex and in the MP3FileReader (which now does the conversion to PCM for you), you take the following line:

decompressor = new AcmMp3FrameDecompressor(this.Mp3WaveFormat); 

and replace it with

decompressor = new DmoMp3FrameDecompressor(this.Mp3WaveFormat); 

Thanks to @Shiroy, I found the amazing NLayer (https://github.com/naudio/NLayer) library By @MarkHeath. If you install it with NLayer.NAudioSupport, you can compress with one additional line of code (and no installed codecs required).

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