WebKit's createMediaStreamSource has a bug which requires it to be called very soon after the stream
is created. If called after a delay it appears to produce a silent webaudio node.
navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
cleanupJobs.push(() => stream.getTracks().forEach(track => track.stop()));
if (useDelay) {
// Bug occurs
return delay(500).then(() => stream);
}
// Bug does not occur
return stream;
}).then((stream) => {
const source = audioCtx.createMediaStreamSource(stream);
// ... Visualize audio data from source
};