surikov / webaudiofont

Use full GM set of musical instruments to play MIDI and single sounds or effects. Support for reverberation and equaliser. No plugins, no Flash. Pure HTML5 implementation compatible with desktop and mobile browser. See live examples.
https://surikov.github.io/webaudiofont/
GNU General Public License v3.0
891 stars 92 forks source link

Android Firefox 68.0 does not support encoding for webaudiofont #35

Closed sdoherty0 closed 5 years ago

sdoherty0 commented 5 years ago

Firefox 68.0 on Android phone will no longer play webaudiofont midi files. Even your simple sample https://surikov.github.io/webaudiofont/examples/simple.html# throws the following error. It is this error for my site as well.

The buffer passed to decodeAudioData contains invalid content which cannot be decoded successfully. EncodingError: The given encoding is not supported.

I don't think it matters which tone file is loaded as your sample loads a different one from my site. Android Chrome works fine and so do desktop (PC) Chrome and Firefox. It is only Android 68.0 Firefox that is throwing this error - as well as Android FF Beta, and Developer's Nightly. So it seems like new mobile Firefox will be incompatible with something in your code base.

Do you have any insight into what could be tweaked to get this working again?

yw662 commented 5 years ago

https://github.com/surikov/webaudiofont/blob/6aa83c160256f542310fb9b9c4676ac4ada4dd52/npm/src/player.js#L262

The buffer is copied byte by byte from the font. https://github.com/surikov/webaudiofont/blob/6aa83c160256f542310fb9b9c4676ac4ada4dd52/npm/src/player.js#L258-L261

Which means, this is related to individual sound fonts. However, it seems that most of the sound fonts are unsupported.

However, it is really wired that ff android does not supported it :-). This issue should be more about android and ff, than webaudiofont, indeed.

surikov commented 5 years ago

I think Android Firefox 68.0 broke some libraries for decoding of audio. WebAudioFont uses different compression for different instruments.

this is uncompressed sample.

sdoherty0 commented 5 years ago

https://surikov.github.io/webaudiofont/examples/dynamic.html using instrument 7.Accousic Grand Piano does work successfully. So this is related to the selection of instruments?

surikov commented 5 years ago

I think Android Firefox 68.0 broke some libraries for decoding of audio. WebAudioFont uses different compression for different instruments.

kbrosnan commented 5 years ago

@sdoherty0 What device and OS are you using?

sdoherty0 commented 5 years ago

I am using a Samsung Galaxy Express Prime running Android 9.0. It is funny because my wife's LG has FF 68.0 and Andriod 8 something and it works. And a friend who is running Andriod 8.1 has FF 68.0 and it works on his phone. Chrome works on my phone. I have uninstalled and reinstalled FF. I have installed the Beta and the Nightly and it fails on all of those on my phone. It might be a way that FF 68.0 accesses some underlying library which might have changed in Android 9.0. But that is weird because Chrome works. So, I'm not sure what the source of this problem is exactly.

sdoherty0 commented 5 years ago

As a followup, this bug in Android FF on Samsung devices has been fixed in FF 70.

kbrosnan commented 5 years ago

This should be fixed for Samsung devices when bug 1565838 ships as part of 68.1 released around Sept 3rd.