How to modify pitch of sound file Java?

6.2k views Asked by At

I have a sound file I would like to modify the pitch of. The file is stored in an MP3. I have searched the internet but have been unsuccessful in finding any libraries or algorithms that would allow me to modify the pitch.

Any examples and/or literature would be appreciated

1

There are 1 answers

0
Erik J On BEST ANSWER

It's not really clear from your question whether you only want to change the playback speed (like the pitch fader on a turntable does) or whether you want to change the pitch without affecting the playback speed. If the latter, you need to use a time stretching/pitch shifting algorithm. See: http://en.wikipedia.org/wiki/Audio_time-scale/pitch_modification

In any case, you'd first have to decode the MP3 into PCM audio. This thread might give you some pointers:

How to get audio data from a MP3?

As for doing pitch shifting in Java, there's some more info here:

Slowing down the playback of an audio file without changing its pitch?