How to change audio tempo and pitch individuality using ffmpeg?

后端 未结 3 435
悲哀的现实
悲哀的现实 2020-12-03 12:27

I have managed to play audio files using ffmpeg and AudioTrack class in my android project. I can change the speed of audio using AudioTrack class setRate method. But it als

相关标签:
3条回答
  • 2020-12-03 13:01

    Pitch and tempo are very strongly linked. What you're trying to do is called "time stretching", and is a somewhat complicated algorithm. You can find information online about it, and a java library for it can be found here, along with a paper describing the process.

    0 讨论(0)
  • 2020-12-03 13:20

    You can use the atempo filter in ffmpeg 1.0 and later:

    ffmpeg -i input.wav -f:a atempo=1.25 output.wav
    

    atempo only accepts values between 0.5 and 2.0, but you can bypass the limitation by chaining multiple filters:

    ffmpeg -i input.wav -f:a atempo=2,atempo=1.5 output.wav
    
    0 讨论(0)
  • 2020-12-03 13:25

    Solution : I tried SoundTouch library. I compiled it successfully for android but then I failed to use its function because I don't know how to use this library to load audio.

    But after that I tried library called Sonic. Its basically for Speech as it use PSOLA algo to change pitch and tempo. But its ok.

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