0

i'm using Ffmpeg to change Audio Pitch and Speed and here's some command i'm trying:

  1. ffmpeg -i audioPath -filter:a atempo=audioSpeed,asetrate=audioPitch -ar sampleRate -b:a xValue(k) output.mp3

  2. ffmpeg -i audioPath -filter:a atempo=(audioSpeed / audioPitch),asetrate=(sampleRate * audioPitch),aresample=sampleRate

and i tried some more commands also with little bit of changes.

(here audioSpeed and audioPitch are in range of 0.5 to 2.0, sampleRate is between 8000 to 48000 and bitRate is between range of 96k to 320k)

Now let's talk about the problem, if we only use atempo, it will change audio speed and if we use asetrate, it will change audio pitch along with speed and looks like it will ignore audioPitch value if we do something like - samplerate * audioPitch (if i use sampleRate = 8000 audio speed will decrease with thick voice and if sampleRate = 48000 audio speed will increase with thin voice(with means audioPitch will adjust according to sampleRate, as of i experienced from output audios))

What i want is if i change audioSpeed to 0.5 and audioPitch to 2.0, then in output file speed will decrease and pitch will be also applied plus i have to change frequency(sample rate) and bitrate..

Any help will be appreciated, Thank you..

Vivek Thummar
  • 395
  • 4
  • 17
  • asetrate accepts a sampling rate, not a ratio. – Gyan Jun 23 '21 at 04:07
  • do you mean by `"atempo=" + audioSpeed + ",asetrate=" + sampleRate` or only `"asetrate=" + sampleRate`? – Vivek Thummar Jun 23 '21 at 04:52
  • @Gyan ohk, basically what i want is, i have to change audio `speed` and `pitch` along with `bitrate` and `frequency/sample rate`, can you please help me to complete this command?? – Vivek Thummar Jun 25 '21 at 04:42

0 Answers0