How to modify pitch of sound file Java? [closed]

2020-03-30 03:01发布

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条回答
Root(大扎)
2楼-- · 2020-03-30 03:18

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?

查看更多
登录 后发表回答