NuGet,搜索安装NReco.VideoConverter

 

ASP.NET AMR文件转换MP3_ios

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.IO;
using NReco.VideoConverter;

namespace AudioConverter
{
class Program
{
static void Main(string[] args)
{
string downPath = Path.GetFullPath("../../download/132532654780617863.amr");
string mp3Path = Path.GetFullPath("../../download/132532654780617863.mp3");

// 音频转换
var ffMpeg = new NReco.VideoConverter.FFMpegConverter();

// 设置比特率为124k
ConvertSettings setting = new ConvertSettings() { AudioSampleRate = 44100 };

// 转换为音频
ffMpeg.ConvertMedia(downPath, "amr", mp3Path, "mp3", setting);

// 转换为视频
//ffMpeg.ConvertMedia("input.mov", "output.mp4", Format.mp4);
}
}
}