Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is better approach to play mp3/wav and change tempo(audio speed) Android?

Tags:

android

I have tried

1) MediaPlayer(it Doesnt support speed change).
2) SoundPool (play only small audio files)
3) AudioTrack (tried with JLayer- there is delay. decoder is slow).
4) Sonic NDK master - unable to play mp3 audio files

what would be better to use? any idea or suggestions? How should i approach?

like image 691
Bhupinder Avatar asked Oct 05 '22 02:10

Bhupinder


1 Answers

Just a bit of information from my experience. OpenSL ES is another option. It is a C++ library so you will need to use the Android NDK. I could not get this method working as for some reason i kept getting an error returned which stated that the interface was unsupported even though it says in the documentation that it is http://mobilepearls.com/labs/native-android-api/ndk/docs/opensles/ .

Another option is use http://www.surina.net/soundtouch/ which is a great C++ library that can be used with the android NDK and has great support from the developer Olli.

In terms of the other methods you have mentioned:

  • MediaPlayer simply will not work
  • Soundpool is very limited due to it only working with small files
  • AudioTrack looks to be the best option but only plays PCM files so conversion of MP3 files may be required.
like image 156
Ray Avatar answered Oct 10 '22 04:10

Ray