如何重复铃声

Ren*_*ith 6 android

我正在使用ringtone = RingtoneManager.getRingtone(this,Settings.System.DEFAULT_RINGTONE_URI); 获取默认铃声,我正在使用ringtone.play(); 这只播放一次铃声,我想玩,直到我打电话给ringtone.stop(); 我可以在日志中看到

12-10 18:37:40.968: DEBUG/Ringtone(2874): playing a tone with looping : false
Run Code Online (Sandbox Code Playgroud)

有没有办法循环?

以下是我的代码,

ringtone = RingtoneManager.getRingtone(this,Settings.System.DEFAULT_RINGTONE_URI);
ringtone.setStreamType(AudioManager.STREAM_NOTIFICATION);
ringtone.play();
Run Code Online (Sandbox Code Playgroud)

Mar*_*one 0

声音文件本身中嵌入了一个循环标志。可能是你的默认铃声没有设置。

这里有更多信息:

http://xanderx.com/2010/08/25/making-ringtones-loop-on-android/