Description
On #109 we fixed audio for older Safari by using the prefixed APIs and older style of node/buffer creation.
It didn't fix speech because modspeech uses a 19000 sample rate but old Safari has a lower bound of 22050 (contrary to the spec but it was early days).
Coincidentally (I assume!), modspeech has a mode=3 option that doubles the sample rate. That mode works in Safari 13. There’s also some code for linear interpolation but not sure it happens with mode=3 or whether it's needed for an OK result.
So far as I can tell we can only trigger mode=3 by passing an undocumented mode keyword argument from user code.
@dpgeorge what is the mode used for? Do you think we could use this or something similar to get a >= 22050 sample rate in the simulator? We could consider doing this just for older Safari if we felt it would impact the output. We could detect the need to do this in the speech hal init function or any point after a user interaction with the simulator.
Alternatively we could look at resampling in JavaScript between modspeech and Web Audio. The older Web Audio API has no support for this so we'd be doing it ourselves.