Android: How to shift pitch of output sound (realtime)

midnighz picture midnighz · Nov 24, 2011 · Viewed 16.3k times · Source

I'm new in Android development. I'm looking for any method that applies pitch shifting to output sound (in real-time). But I couldn't find any point to start.

I've found this topic but I still don't know how can I apply this.

Any suggestions?

Answer

Anthony Blake picture Anthony Blake · Nov 24, 2011

In general, the algorithm is called a phase vocoder -- searching for that on the Internets should get you started.

There are a few open source phase vocoders out there, you should be able to use those for reference too.

You can do phase vocoder in real-time -- the main component used is the FFT, so you'll need a fast FFT. The Android libraries can do this for you, see this documentation: http://developer.android.com/reference/android/media/audiofx/Visualizer.html

As it happens, I'm about to release an open source FFT for ARM that is faster than Apple's vDSP library (which was hitherto the fastest). I'll post back in a few days when I've uploaded it to github.com.

Good luck.