如何在Android中无间隙地循环声音? [英] How to loop a sound without gaps in Android?

查看:33
本文介绍了如何在Android中无间隙地循环声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在android中循环播放没有间隙的声音.我尝试使用代码 mediaplayer.setLooping(true) 来循环播放声音,但是在第一个声音结束和下一个声音开始时总是有一点停顿.

I want to loop a sound without gaps in android. I tried to use the code mediaplayer.setLooping(true) to loop the sound, but there is always a little pause when the first sound is over and the next sound start.

推荐答案

尝试对应用程序中的声音文件使用 .ogg 文件格式.我遇到了同样的问题,经过大量研究,我尝试了 .ogg 格式,它在 android 中没有任何间隙地循环.

Try using the .ogg file format for the sound files in your application. I had this same issue, and after a lot of research , i tried the .ogg format and it loops without any gaps in android.

关于 .ogg 格式的信息:http://en.wikipedia.org/wiki/.ogg

Info about .ogg format: http://en.wikipedia.org/wiki/.ogg

您可以使用流行的开源应用程序 VLC 媒体播放器.

You can easily convert your sound file from .mp3 or what have you, to .ogg using the popular open source app VLC Media Player.

这篇关于如何在Android中无间隙地循环声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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