I am trying to play audio from https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd
using a custom player. The player I have does the following:
- Downloads and decodes each segment of audio one at a time using Web
Audio API’s AudioDecoder - Stitches all the decoded data from each segment together into a 4 (4-ish since it’s actually 192512/48000) second long Float32Array for each channel.
- Creates an
AudioBufferSource
usingaudioCtx.createBufferSource()
and attaches the Float32Arrays buffer to it. - Schedules the
AudioBufferSource
to play using the timing information. So first segment is scheduled at 0 to play forsegment.duration
, second segment is scheduled from the previous segment’s end time, etc.
When doing this I get about 0.1 seconds of silence between segments. Moreover, the beginning of most (but not all segments) contains roughly 360 samples that are just 0.
When I play the same DASH stream through the dash.js player I don’t get the same effect. Is the problem I am seeing with my scheduling algorithm, my decoding strategy, or is there something fancy that other players do to blend the sound together to prevent this artifact?