问题
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!
回答1:
if you are using Azure App Service, most likely some of the call would be blocked by sandbox.
you can use Azure Media Service to do the encode/decode work for you https://azure.microsoft.com/en-us/services/media-services/
回答2:
I second Xiaomin on the sandbox point. COM access is blocked in App Service.
That being said, ffmpeg
works just fine. Process invoke it from your C#.
ffmpeg: https://ffmpeg.org/download.html
A discussion on C# wrappers for ffmpeg here:
Solid FFmpeg wrapper for C#/.NET
来源:https://stackoverflow.com/questions/38646461/how-to-decode-mp3-to-wav-on-azure-webapp