Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 393
Adam Avatar asked Dec 30 '09 03:12

Adam


People also ask

Why is Bose discontinuing SoundTouch?

"As we are evolving our product assortment to better serve your needs, we are discontinuing sales of some SoundTouch products. We remain committed to support both the SoundTouch app and product software for the foreseeable future. Please visit the Support section if you need any help with your SoundTouch products."

How do I connect my SoundTouch to my phone?

To enter pairing mode:In the SoundTouch app, go to Menu ☰ > Settings > Speaker Settings, then select your product. From the Speaker Details screen, select Bluetooth. Select Connect New Device: The Ready to connect screen appears to confirm.

Does Bose SoundTouch work with Google?

Using Google Assistant with Bose products ensures that your music, podcasts, and phone calls will sound deep, clear, and full of life. Google Assistant helps you across devices, like Google Home, your phone — and your Bose speaker, soundbar, or headphones.


1 Answers

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.

like image 183
dmazzoni Avatar answered Oct 11 '22 21:10

dmazzoni