开发者

Android: Gapless playback of a looped audio file in MediaPlayer

开发者 https://www.devze.com 2023-01-20 16:57 出处:网络
I am playing a setLooped enabled audio file in my app, but every time the audio file loops, there is a noticeable, 开发者_高级运维though very brief, gap in the audio playback... is there any way to ge

I am playing a setLooped enabled audio file in my app, but every time the audio file loops, there is a noticeable, 开发者_高级运维though very brief, gap in the audio playback... is there any way to get around this?


I was just facing the same problem and I guess you have been using MP3 or OGG files or some other compressed format. The solution is to use WAV files instead. This may increase your apk size but lets you loop gapless.


I had the same problem and did try to switch from MP3 to WAV. Then looping worked gaplessly in emulator, but not in my phone. Using OGG files actually made it work in phone too. So using .ogg could be worth a shot too, but I don't actually underst

0

精彩评论

暂无评论...
验证码 换一张
取 消