diff --git a/config_example.json b/config_example.json index 7ba1db3..1eac95e 100644 --- a/config_example.json +++ b/config_example.json @@ -187,4 +187,4 @@ "spawnTimeout": 30000, "spawnDelay": 5000 } -} +} \ No newline at end of file diff --git a/src/music/audio/FluxerAudioBridge.mjs b/src/music/audio/FluxerAudioBridge.mjs index f1057fd..8ef16dd 100644 --- a/src/music/audio/FluxerAudioBridge.mjs +++ b/src/music/audio/FluxerAudioBridge.mjs @@ -196,7 +196,7 @@ export class FluxerAudioBridge extends EventEmitter { headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", "Accept": "*/*", - "Icy-MetaData": "1", + "Icy-MetaData": "0", }, }); stream = opened.stream; diff --git a/src/music/audio/StreamPositioner.mjs b/src/music/audio/StreamPositioner.mjs index 7917c44..5d1234b 100644 --- a/src/music/audio/StreamPositioner.mjs +++ b/src/music/audio/StreamPositioner.mjs @@ -327,10 +327,8 @@ export class StreamPositioner extends Transform { // Emit: cluster header (+ Timecode) then from the first surviving block on. const skipped = firstKeptOffset - firstBlockRegionStart; - this._consume(firstKeptOffset); // buffer now starts at the surviving block if (skipped > 0) { - // Blocks were trimmed — the original size vint would now overstate the - // payload and desync the demuxer. Rebuild the header with the real size. + this._consume(firstKeptOffset); const keptPayload = (firstBlockRegionStart - headerLen) + (cluster.length - firstKeptOffset); this.push(Buffer.concat([ @@ -451,19 +449,18 @@ export class StreamPositioner extends Transform { if (pageLen > MAX_OGG_PAGE_BYTES) { this._startPassthrough(); return; } if (this._buf.length < pageLen) return; - const granule = Number(this._buf.readBigUInt64LE(6)); + const rawGranule = this._buf.readBigUInt64LE(6); const page = Buffer.from(this._buf.subarray(0, pageLen)); this._consume(pageLen); if (this._oggPagesKept < 2) { - // OpusHead (BOS) + OpusTags pages must survive for the demuxer. this._oggPagesKept++; this.push(page); continue; } - const isFiller = granule === -1n || granule === 0xffffffffffffffffn; - if (!isFiller && granule >= this._targetMs * OPUS_SAMPLE_RATE) { + const isFiller = rawGranule === 0xffffffffffffffffn; + if (!isFiller && Number(rawGranule) >= this._targetMs * OPUS_SAMPLE_RATE) { for (const p of this._oggReplay) this.push(p); this._oggReplay = []; this._startPassthrough(page);