@banou/ripple 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/assets/libtorrent-DleyqKUt.js +6 -0
- package/assets/{worker-D9BVfXBc.js → worker-Dx1oQ7Q_.js} +1 -1
- package/fkn.json +1 -1
- package/index.js +11439 -10988
- package/jassub/jassub-worker-modern.wasm +0 -0
- package/jassub/jassub-worker.js +1 -1
- package/jassub/jassub-worker.wasm +0 -0
- package/jassub/worker.js +30 -34
- package/libav-jspi.wasm +0 -0
- package/libav.wasm +0 -0
- package/package.json +1 -1
- package/sw.js +2 -2
- package/volume-normalizer-worklet.js +14 -4
- package/assets/libtorrent-DY7aMUNo.js +0 -6
package/sw.js
CHANGED
|
@@ -8,8 +8,8 @@ const live = new Map()
|
|
|
8
8
|
/* Stamped at build time. These are the dev defaults and must never reach production: a worker whose
|
|
9
9
|
BUILD never changes is never reinstalled, so the update this feature announces would never fire. */
|
|
10
10
|
const MODE = "cache" // @stamp:mode
|
|
11
|
-
const BUILD = "
|
|
12
|
-
const MANIFEST = [["/assets/empty-BvRk9kiK.js","e3b0c44298fc1c14"],["/assets/libtorrent-
|
|
11
|
+
const BUILD = "cb8353dc5e7aa834" // @stamp:build
|
|
12
|
+
const MANIFEST = [["/assets/empty-BvRk9kiK.js","e3b0c44298fc1c14"],["/assets/libtorrent-DleyqKUt.js","27516279f85831f1"],["/assets/worker-Dx1oQ7Q_.js","f43c4541e44036f4"],["/build-B7te3F-u.js","47b056c564f078c5"],["/remote-DvdN47iT.js","b0649250a9e3a079"],["/volume-normalizer-worklet.js","f317010b936c83f5"]] // @stamp:manifest
|
|
13
13
|
|
|
14
14
|
const CACHE = 'ripple-assets-' + BUILD
|
|
15
15
|
|
|
@@ -629,12 +629,15 @@ export const createAnalysis = ({ toWorklet, toPage = () => {} }) => {
|
|
|
629
629
|
}
|
|
630
630
|
|
|
631
631
|
/*
|
|
632
|
-
* The worker's side: fragments from a second libav remuxer reading the same file, decoded with
|
|
632
|
+
* The worker's side: fragments from a second libav remuxer reading the same file, or from playback's own, decoded with
|
|
633
|
+
* WebCodecs.
|
|
633
634
|
*
|
|
634
635
|
* { type: 'port', port } the worklet's end of a MessageChannel, for the blocks
|
|
635
636
|
* { type: 'init', data, codec } the init segment and the codec string MediaSource was given
|
|
636
637
|
* { type: 'run', run, pts, start } a run of fragments starts, `pts` added to their times as the SourceBuffer's
|
|
637
|
-
* timestampOffset adds it for playback; `start` for the one from the start
|
|
638
|
+
* timestampOffset adds it for playback; `start` for the one from the start,
|
|
639
|
+
* and `join: true` for one whose first fragments went by unseen, which starts
|
|
640
|
+
* at its first sample
|
|
638
641
|
* { type: 'fragment', run, data } answered { type: 'ack', run, spans, end, normal } once its audio is queued
|
|
639
642
|
* for decoding: the analysed seconds, the file's end once known, and the
|
|
640
643
|
* level learned so far in LUFS
|
|
@@ -651,6 +654,7 @@ const serve = (scope) => {
|
|
|
651
654
|
let decoder
|
|
652
655
|
let runId = -1
|
|
653
656
|
let pts = 0
|
|
657
|
+
let joining = false
|
|
654
658
|
const analysis = createAnalysis({
|
|
655
659
|
toWorklet: (message, transfer) => port?.postMessage(message, transfer),
|
|
656
660
|
toPage: (message) => scope.postMessage(message),
|
|
@@ -707,10 +711,16 @@ const serve = (scope) => {
|
|
|
707
711
|
runId = data.run
|
|
708
712
|
pts = data.pts
|
|
709
713
|
open(runId)
|
|
710
|
-
|
|
714
|
+
joining = !!data.join
|
|
715
|
+
if (!joining) analysis.startRun(runId, pts, data.start)
|
|
711
716
|
} else if (data.type === 'fragment') {
|
|
712
717
|
if (data.run !== runId || decoder.state !== 'configured') return
|
|
713
|
-
|
|
718
|
+
const samples = audioSamplesOf(data.data, track)
|
|
719
|
+
if (joining && samples.length) {
|
|
720
|
+
joining = false
|
|
721
|
+
analysis.startRun(runId, pts + samples[0].time / track.timescale)
|
|
722
|
+
}
|
|
723
|
+
for (const sample of samples) {
|
|
714
724
|
const time = pts + sample.time / track.timescale
|
|
715
725
|
stamps.push(time)
|
|
716
726
|
decoder.decode(new EncodedAudioChunk({
|