0
点赞
收藏
分享

微信扫一扫

ASP.NET AMR文件转换MP3

诗尚凝寒 2022-07-27 阅读 62


 NuGet,搜索安装NReco.VideoConverter

 

ASP.NET AMR文件转换MP3_比特率

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);
}
}
}

 

举报

相关推荐

0 条评论