Decode MP3, then increase the audio volume, and then encode the new audio

前端 未结 1 1451
自闭症患者
自闭症患者 2021-02-08 22:26

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 thi

相关标签:
1条回答
  • 2021-02-08 23:15

    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

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

    For instance,

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

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

    0 讨论(0)
提交回复
热议问题