有2媒体播放器中的对象同步播放 - Android电子 [英] Having 2 Mediaplayer objects playing in sync - Android

查看:171
本文介绍了有2媒体播放器中的对象同步播放 - Android电子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid游戏,我想有一个节奏MediaPlayer对象和铅MediaPlayer对象同步播放。然而此刻的节奏是引线媒体播放器对象的再现后面的轻微位。有没有一种方法,我可以让这个两者都在同一时间使用的Runnable开始,比如等?!

In my android game I want to have a rhythm Mediaplayer object and a lead Mediaplayer object playing in sync. However at the moment the rhythm is a slight bit behind the playback of the lead Mediaplayer object. Is there a way I can make it so that both are started at the same time, for instance using Runnables etc?!

这是相当关键的,他们在同步播放与对方,你可以想像!非常感谢

It's quite crucial that they play in sync with each other as you can imagine! Many thanks

推荐答案

请尝试使用的Soundpool 这似乎只是为这样的任务创建。一个例如

Try using SoundPool which seems to be created just for this kind of task. An example.

另外对于那些同步到用户操作的声音使用喷气的声音

Also for the sounds that are synced to user actions use Jet sounds.

这篇关于有2媒体播放器中的对象同步播放 - Android电子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆