NAudio Error: "NoDriver calling acmFormatSuggest"

I have a project that uses NAudio to convert from mp3 to wav. (using the WaveFormatConversionStream.CreatePcmStream() method)

It worked fine on my development machine, but now I'm trying to use it on a new new server and throwing this error:

NAudio.MmException: NoDriver calling acmFormatSuggest
in NAudio.MmException.Try (result of MmResult, String function)
at NAudio.Wave.Compression.AcmStream.SuggestPcmFormat (WaveFormat with Compressed Format)
in NAudio.Wave.WaveFormatConversionStream.CreatePcmStream (original WaveStream)

I assume that there is some dependency that is required here, but not on the new server. What is it and where to install it?

A server is a freshly captured 32-bit instance of Amazon EC2 Windows 2008 with the roles "web server" and "application server" installed.

+6
source share
3 answers

Starting Windows 2008 R2, using Naudio to determine the length of the Wav and Mp3 files, I ran into the same problem.

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

Essentially, install the "Desktop Experience" feature.

The above will require a server reboot.

Once this was established, I no longer needed to activate, the problem was resolved.

+7
source

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

NAudio offers another way to decode MP3s using DMO MP3 Decoder (DirectX Media Object), which can also be on your target computer. To use this, you need to get the latest NAudio source from Codeplex and to MP3FileReader (which now performs PCM conversion for you), you take the following line:

 decompressor = new AcmMp3FrameDecompressor(this.Mp3WaveFormat); 

and replace it with

 decompressor = new DmoMp3FrameDecompressor(this.Mp3WaveFormat); 
+2
source

Thanks to @Shiroy, I found the awesome NLayer ( https://github.com/naudio/NLayer ). Posted by @MarkHeath. If you install it using NLayer.NAudioSupport, you can compress one additional line of code (and no codecs are required).

0
source

Source: https://habr.com/ru/post/885841/


All Articles