android mediaplayer alternative?

痞子三分冷 提交于 2019-12-08 00:55:42

问题


Is there a java audio library that is capable of setting the playback rate of the audio(controlling the speed of the audio) as well as being able to return me the current position of the playback and the total duration of the audio stream?

I noticed that the android mediaplayer would be able to return me the current position of the playback and the total duration of the audio stream but it doesn't let me set the playback rate.

And unfortunately the android soundpool lets me set the playback rate but doesn't let me get the current position or the total duration of the audio stream.

Do you guys have any suggestion for what java library would be able to help me out. Any suggestion would be appreciated, thanks.


回答1:


The popular Android pod casting application DoggCatcher uses a third party player called Presto for this. I haven't looked into how you interact with it programmatically but it functions good in DoggCatcher when I use it there.

http://www.aocate.com/presto/

https://play.google.com/store/apps/details?id=com.aocate.presto&hl=en




回答2:


Try the SoundPool class.

The play function seems to have all of the features you're looking for...

SoundPlayer.play(int soundID, float leftVolume, float rightVolume,
                 int priority, int loop, float rate)

There are also setter functions that can be really useful.

e.g. void setRate(int streamID, float rate)



来源:https://stackoverflow.com/questions/13946088/android-mediaplayer-alternative

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!