This might be irrelevant once the player is converted to AudioWorkers, but:
Each Player implementation currently has its own ScriptProcessorNode (i.e., see call to createScriptProcessor() in Player base constructor).
In the beginning, these nodes would be added and removed from the audio graph based on playback.
That caused audible lags/audio glitches, so the solution was to leave the nodes attached to the graph once created.
This has a slight performance overhead (made more obvious with ?debug=true param) - eventually 6 audioProcess callbacks are being called at once (one for each Player implementation).
The players are all "paused" but they still have to fill the buffer with zeros on every audioProcess callback.
This seems dumb; why not create one master ScriptProcessorNode and have the audioProcess method delegate to the implementations ("do you want to write any audio")? At least this way, there is only ever one buffer being filled with zeros, and for stopped players, the audioProcess is a no-op.
This might be irrelevant once the player is converted to AudioWorkers, but:
createScriptProcessor()
in Player base constructor).?debug=true
param) - eventually 6audioProcess
callbacks are being called at once (one for each Player implementation).audioProcess
callback.audioProcess
method delegate to the implementations ("do you want to write any audio")? At least this way, there is only ever one buffer being filled with zeros, and for stopped players, theaudioProcess
is a no-op.