Adam
Adam

Reputation: 167

SoundTouch on Android?

Hey, I am trying to change the pitch of an audio file in an android application.

I have found an open source library online "SoundTouch" (http://www.surina.net/soundtouch), do you think I can use this library in an android app?

I have been Googling "SoundTouch in Java" an have found this data (http://www.aplu.ch/classdoc/jaw/ch/aplu/jaw/SoundTouch.html).

Possible this library I can use or any ideas about any other libraries or process I can use to alter the pitch of an audio file on android? I have also looked into the Java Sound API an android does not support them. :/

Thanks Adam

Upvotes: 5

Views: 5637

Answers (2)

sachinNadgouda
sachinNadgouda

Reputation: 56

https://github.com/nonameentername/soundtouch-android

please follow the above link and just build with ndk. The source of soundtouch is wrong so please download and replace it. Build on a linux enviornment. For any queries please get back to me.

If you want to change the pitch of sound you can use openal

http://pielot.org/2011/11/10/openal4android-2/

Upvotes: 4

dmazzoni
dmazzoni

Reputation: 13256

Have you thought about just changing the sample rate? If you load the raw audio samples into memory and play them using Android's AudioTrack class, you can specify a wide range of possible sample rates and Android will resample for you. This will change both the pitch and tempo, like playing a record at the wrong speed. If you absolutely need to change the pitch without affecting the tempo, you'll need SoundTouch or something similar.

Anyway, this is definitely possible, but it will take a fair amount of work.

You'll need to use the Android NDK (native development kit) to compile SoundTouch. The Java wrapper you found might be helpful, but ultimately you'll need to get your hands dirty with the NDK.

You'll also need to write your own code to read the audio file from disk, and then buffer it through SoundTouch and out through the AudioTrack class. MediaPlayer won't help you here.

Finally, note that you'll need to abide by the terms of the LGPL when releasing your app.

Upvotes: 4

Related Questions