How to decode mp3 to wav on Azure WebApp

二次信任 提交于 2019-12-25 06:25:26

问题


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

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