2

So maybe someone has experience with advanced audio handling in mobile browsers!

I have problems in setting the current time of the audio player. On desktop browsers and iOS it all works perfect. I set the current time to my next sprite and then play until current time reaches the end of my sprite.

On android I set the current time and after the first timeupdate-event gets fired the current time of my audioplayer is about 15-20 sec later!!! So my sprite will not be played because my sprites are only 8 sec long.

I really need that sprite handling, because on mobile browsers we can only access one player and I dont wanna waste time in creating and audio element, downloading the source and set the src. This takes to much time...

I will also be very happe if there is another solution. Someone tried to have the audio player and stream audio in that from an server??

4

1 回答 1

2

如果有人有兴趣,我有一个解决方案!

错误是使用比特率模式变量导出音频文件(android 浏览器的 mp3)。首先我选择可变比特率模式,因为我的精灵之间有很多空白空间,使用这个选项我可以节省文件大小!虽然 android 浏览器的编解码器可以处理这些可变数据,但是当我尝试为我的文件设置一个明确的时间时,它可能会提前或推迟 10-12 秒。这取决于您如何意外地撞击可变数据块。

为了不给可变数据块带来麻烦,我将我的 mp3 导出为具有中等质量 (145-185 kbps) 的预设比特率模式。我的文件比可变比特率模式大 30%,但现在可以使用了!!

于 2013-02-14T14:22:01.737 回答