NAudio 错误:“NoDriver 调用 acmFormatSuggest”
我有一个使用 NAudio 将 mp3 转换为 wav 的项目。 (使用 WaveFormatConversionStream.CreatePcmStream() 方法)
它在我的开发计算机上运行良好,但现在我在全新的服务器上尝试它并抛出此错误:
NAudio.MmException:NoDriver 调用 acmFormatSuggest
在 NAudio.MmException.Try(MmResult 结果,字符串函数)
在 NAudio.Wave.Compression.AcmStream.SuggestPcmFormat(WaveFormatcompressedFormat)
在 NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(WaveStream sourceStream)
我假设 NAudio 这里需要一些不在新服务器上的依赖项。它是什么以及我应该从哪里安装它?
服务器是新孵化的 Amazon EC2 Windows 2008 32 位实例,安装了“Web 服务器”和“应用程序服务器”角色。
I've got 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 it on a fresh new server and its throwing this error:
NAudio.MmException: NoDriver calling acmFormatSuggest
at NAudio.MmException.Try(MmResult result, String function)
at NAudio.Wave.Compression.AcmStream.SuggestPcmFormat(WaveFormat compressedFormat)
at NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(WaveStream sourceStream)
I assume there is some dependency that NAudio needs here that isn't on the new server. What is it and where should I install it from?
Server is a freshly-hatched Amazon EC2 Windows 2008 32-bit instance with 'web server' and 'app server' roles installed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
运行Windows 2008 R2,使用Naudio检测Wav和Mp3文件的长度,我遇到了同样的问题。
我通过以下方法解决了这个问题: https://technet.microsoft.com/en- us/library/cc772567.aspx
本质上,安装“桌面体验”功能。
上述操作需要重新启动服务器。
安装上述内容后,我不需要再启用任何内容,问题就解决了。
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 使用您计算机上安装的 ACM 编解码器。它首先询问是否安装了任何可以从源格式转换为目标格式的 ACM 编解码器。您似乎在目标计算机上缺少 MP3 编解码器。
NAudio 确实提供了一种不同的方式来解码 MP3,即使用 DMO MP3 解码器(DirectX 媒体对象),该解码器也可能位于您的目标计算机上。要使用它,您需要从 Codeplex 获取最新的 NAudio 源,并在 MP3FileReader(现在为您转换为 PCM)中,您使用以下行:
并将其替换为
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:
and replace it with
感谢@Shiroy,我找到了令人惊叹的 NLayer (https://github.com/naudio/NLayer )图书馆作者:@MarkHeath。如果您使用 NLayer.NAudioSupport 安装它,则可以使用一行额外的代码进行压缩(并且不需要安装编解码器)。
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).