如何在Azure WebApp上将mp3解码为WAV [英] How to decode mp3 to wav on Azure WebApp
问题描述
当我的asp.net mvc5应用程序在Azure上运行时,使用NAudio将mp3解码为wav(或字节数组或pcm流)时,我遇到了问题.在本地IIS上,它可以正常工作.但是在Azure上,调用Mp3FileReader时出现"System.Runtime.InteropServices.COMException". 我认为这可能是缺少编解码器的原因.我怎么解决这个问题?有没有办法做参考或什么? 预先感谢!
I have a problem with decoding mp3 to wav (or byte array, or pcm stream) using NAudio when my asp.net mvc5 application running on Azure. On the local IIS it works properly. But on the Azure I'm getting "System.Runtime.InteropServices.COMException" when calling Mp3FileReader. I think it may be cause of missing codecs. How can I solve this problem? Is there a way to make a reference or something? Thanks in advance!
推荐答案
我在沙盒点上第二个小敏.在App Service中,COM访问被阻止.
I second Xiaomin on the sandbox point. COM access is blocked in App Service.
话虽这么说,ffmpeg
正常工作.流程从您的C#调用它.
That being said, ffmpeg
works just fine. Process invoke it from your C#.
ffmpeg:: https://ffmpeg.org/download.html
ffmpeg的C#包装器的讨论在这里:
用于C#/.NET的纯FFmpeg包装器
ffmpeg: https://ffmpeg.org/download.html
A discussion on C# wrappers for ffmpeg here:
Solid FFmpeg wrapper for C#/.NET
这篇关于如何在Azure WebApp上将mp3解码为WAV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!