0

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!

Egor Shoba
  • 95
  • 1
  • 8

2 Answers2

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/

Xiaomin Wu
  • 3,621
  • 1
  • 15
  • 14
  • I'll try that, thanks! But it seems to be too powerful tool for a one simple task. Is there any environment independed libraries for decoding mp3? – Egor Shoba Jul 29 '16 at 05:12
  • It seems as though Azure Media Service supports WAV as an input format but not for output. – pilcrowpipe Dec 27 '16 at 05:16
1

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#.

enter image description here

ffmpeg: https://ffmpeg.org/download.html
A discussion on C# wrappers for ffmpeg here: Solid FFmpeg wrapper for C#/.NET

Community
  • 1
  • 1
evilSnobu
  • 24,582
  • 8
  • 41
  • 71