Folks,
In my Android application, I record audio and play it back. The user is usually a singer.
I now need the ability to play the audio back at reduced speed.
As I understand, PCM data is simply a mix of sine waves at different frequencies. There is one dominant wave (highest magnitude) that results in the musical notes of the song.
To reduce the speed by 2 times, at first I thought I will just duplicate each sample. For example, if the sampled input PCM values are 20000, 25000, 30000, ..., I will play back 20000, 20000, 25000, 25000, 30000, 30000. However, this doesn't seem to be the right solution. All I seem to be doing here is increasing the wavelength (therefore frequency) of the sine waves. I think this will result in changing the voice/notes.
Can someone please suggest how to reduce or increase the speed?
Thank you in advance for your help.
Regards, Peter
If by speed you mean varying the voice in the PCM data from slow (tall giant) to fast (chipmunk) then
you might want to look at this algorithm for pitch shifting.. The idea is to get the right sampling rate as per the pitch that you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With