2

对于我的 Android 应用,我想要背景音乐。它不必跨越活动,因此服务无关紧要。

Soundpool 似乎在大约 6 秒后停止播放 .ogg 或 .mp3 MediaPlayer 无法更改音乐的速度(速率)

我想做的是允许用户在播放背景音乐时改变它的速度。SoundPool 似乎可以做到这一点,但很难说,因为它只播放几秒钟。

关于如何做到这一点的任何建议?

4

1 回答 1

1

SoundPool 对 wav 文件不好,而使用 mp3 我没有问题...

    public final int play (int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate) 

浮动速率 - 值 0.5 表示以半速播放,可以是 0.5-2.... 我认为您应该使用 SoundPool... 至于我,我很欣赏 Mediaplayer...

于 2012-01-19T17:46:45.200 回答