同时播放多个音频文件
我想同时同步播放多个音频文件。我想使用其 URI 加载文件(源可以是铃声、SD 卡上的文件或特定文件夹中的文件)。我希望能够延迟文件并调整播放速率。我研究过 SoundPool 和 MediaPlayer,但我不确定哪一个最好。 MediaPlayer 似乎是正确的路径,但我不知道存储和播放不同播放器的最佳方法。
I want to play multiple audio files simultaneously in sync. I want to load the files using their URI (source will be either a Ringtone, file on the SDcard, or a file in a specific folder). I want to be able to put a delay on the files and adjust the play rate. I have looked into SoundPool and MediaPlayer, but I am unsure of which one is best. MediaPlayer seems like the right path, but I don't know the best method to store and play the different players.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有人告诉我,如果您没有很多文件,MediaPlayer 更容易使用,而 SoundPool 则适用于更复杂的事情,例如您想要游戏的声音。我认为如果您使用 MediaPlayer API,您就不能设置延迟并调整播放速率,但似乎没有该功能: http://developer.android.com/reference/android/media/MediaPlayer.html
I have been told that MediaPlayer is easier to work with if you don't have a lot of files, and SoundPool is for more complicated things like if you want to have sounds for a game. I don't think you can put delays and adjust the play rate if you use the MediaPlayer API though, it doesn't seem like there's that function: http://developer.android.com/reference/android/media/MediaPlayer.html