How I Use Audio Worklet to Replace AudioBufferSourceNode

Background

Recently I have been refactoring Nikku, web-based BRSTM audio player. After I moved out the audio decoding part to a worker thread, I noticed that passing data between main thread and worker thread causes a significant delay before the audio can be played back.