背景音乐长度和速度
对于我的 Android 应用程序,我想要背景音乐。它不必跨越活动,因此服务并不重要。
Soundpool 似乎在大约 6 秒后停止播放 .ogg 或 .mp3 MediaPlayer 无法更改音乐的速度(速率)
我想做的是允许用户更改正在播放的背景音乐的速度。 SoundPool 似乎可以做到这一点,但很难说,因为它只播放几秒钟。
对于如何执行此操作有什么建议吗?
For my Android app I would like background music. It doesn't have to go across activities so services do not matter.
Soundpool seems to stop playing the .ogg or .mp3 after about 6 seconds
MediaPlayer doesn't have the ability to change the speed (rate) of the music
What I would like to do is to allow the user to change the speed of the background music as it is playing. It would seem like SoundPool can do this but its hard to tell since it only plays for a few seconds.
Any suggestions for how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SoundPool 对于 wav 文件来说很糟糕,对于 mp3 我没有问题...
浮动速率 - 值 0.5 意味着以半速播放,可以是 0.5-2...我认为你应该使用 SoundPool... 作为对我来说,我很欣赏 Mediaplayer...
SoundPool is bad with wav files, with mp3 I didn't have problems...
float rate - value of 0.5 means playback at half speed, can be 0.5-2.... I think you ought to use SoundPool... As for me, I appreciate Mediaplayer...