android – How do I modify the pitch of a recorded audio without changing the frequency?


I made a simple recording app and now I want to allow the user to playback the sound as normal or with the pitch higher or lower.

I used SoundPool and it kinda worked (the audio was high pitched), but the problem is that the audio sped up (because I changed the frequency by 2x). How do I change the pitch while leaving the frequency alone? Is that something SoundPool can do or would I need to use something else?

sp?.play(soundId, 1F, 1F, 1, 0, 2F)