Audio tone change when changing speed in IJKPlayer

115 Views Asked by At

I am working with ijkplayer video player library to play videos in my android app.But when i try to increase the audio speed (e.g 1.5+) it change my audio tone.I looked into the source code of ijkplayer but couldn't figure out the issue. When setting playback rate it calculates pitch and sample rate which seems working to me.I enabled soundtouch for playing audio.Can anyone help me figure out how i can fix this issue. If you need more information please leave a comment.

1

There are 1 best solutions below

0
On

I'm not familiar with the specific software you are using, but a fundamental aspect of sound is that if you change the rate of the playback, this will change the pitch of the sound. Sound is measured in pulses per unit time, for example, in Hertz, which is waves per second, where 440 Hz is the A note used to tune an orchestra. If you change the rate of playback to speed it up 50%, the resulting sound will vibrate at 660 Hz, which is the E above that A.

If you want to change the playback rate without altering the pitch, this will require additional digital signal processing. The algorithm is a bit too complex for me to explain here. It involves breaking the original signal up into 'granules' and rejoining them. The process is specialized enough that it is something more commonly dealt with at another forum, dedicated to Signal Processing.