解码MP3,然后增加音频音量,然后对新音频进行编码 [英] Decode MP3, then increase the audio volume, and then encode the new audio

查看:237
本文介绍了解码MP3,然后增加音频音量,然后对新音频进行编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想首先解码一个MP3音频文件,然后增加音频的音量,然后再次将其编码成一个新的MP3文件。我想为此使用libavformat或libavcodec。你能帮我一下吗任何一个例子?

I want to first decode a MP3 audio file, and then increase the volume of the audio, and then encode it again into a new MP3 file. I want to use libavformat or libavcodec for this. Can you help me how I can do this? Any example?

推荐答案

您可以使用-filter参数与volume选项来设置一个 为音频。更多信息: http://ffmpeg.org/ffmpeg-filters.html#volume

You can use the "-filter" parameter with the "volume" option to set a multiplier for the audio. More info: http://ffmpeg.org/ffmpeg-filters.html#volume

由于您只处理MP3文件(只有一个音轨),您可以使用-af参数,它是-filter:一个。

Since you are dealing only with MP3 files (that have only one audio track), you can use the "-af" parameter, which is an alias for "-filter:a".

例如,

ffmpeg -i input.mp3 -af 'volume=1.5' output.mp3

将增加50%的音量并创建输出文件与输入(MP3)相同的编解码器。

would increase the volume in 50% and create the output file with the same codec as input (MP3).

这篇关于解码MP3,然后增加音频音量,然后对新音频进行编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆