timidity
timidity copied to clipboard
Tempo and pitch on Windows/Android
Some platforms/systems use a sampleRate of 48000. This results in faster, higher pitched play back. The fix is to use the sampleRate from the audio context:
_loadSong(midiBuf) {
const optsPtr = this._lib._mid_alloc_options(
this._audioContext.sampleRate || DEFAULT_SAMPLE_RATE,
AUDIO_FORMAT,
NUM_CHANNELS,
BUFFER_SIZE
)
I saw this too in bitmidi.com and another site that used this API.
I never thought the results of browser code would be OS-dependent.