ANDROID_LOOP = true — how to avoid MediaPlayer looping audios with this metadata tag

后端 未结 1 1275
孤城傲影
孤城傲影 2021-01-18 11:42

I want to play device ringtones with MediaPlayer yet it seems when the metadata tag

ANDROID_LOOP = true

is set MediaPlayer is ignoring the

相关标签:
1条回答
  • 2021-01-18 12:29

    Might not be a satisfactory answer, but it seems the engineers are not inclined to change the behavior of MediaPlayer and the metadata tag ANDROID_LOOP=true for ogg files. See issue: http://code.google.com/p/android/issues/detail?id=1314

    As for temporarily modifying the tag, I don't know how you could go about doing that.

    I haven't tested it but I believe other sound formats don't exhibit this behavior (e.g. mp3 or wav). Perhaps you could convert the ogg files to a different format and keep them as temp data (might help with this: Java - Convert ogg to mp3) This of course seems like a lot of overhead to play back some files, but at least they're usually small files.

    0 讨论(0)
提交回复
热议问题