@basmilius/apple-raop 0.9.13 → 0.9.15
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/dist/index.mjs +6 -9
- package/package.json +7 -6
package/dist/index.mjs
CHANGED
|
@@ -211,7 +211,7 @@ var ControlClient = class extends EventEmitter {
|
|
|
211
211
|
//#endregion
|
|
212
212
|
//#region src/rtspClient.ts
|
|
213
213
|
const USER_AGENT = "AirPlay/550.10";
|
|
214
|
-
const FRAMES_PER_PACKET$
|
|
214
|
+
const FRAMES_PER_PACKET$1 = 352;
|
|
215
215
|
const AUTH_SETUP_UNENCRYPTED = Buffer.from([1]);
|
|
216
216
|
const CURVE25519_PUB_KEY = Buffer.from([
|
|
217
217
|
89,
|
|
@@ -265,7 +265,7 @@ function buildAnnouncePayload(options) {
|
|
|
265
265
|
"t=0 0",
|
|
266
266
|
"m=audio 0 RTP/AVP 96",
|
|
267
267
|
`a=rtpmap:96 L16/${options.sampleRate}/${options.channels}`,
|
|
268
|
-
`a=fmtp:96 ${FRAMES_PER_PACKET$
|
|
268
|
+
`a=fmtp:96 ${FRAMES_PER_PACKET$1} 0 ${options.bitsPerChannel} 40 10 14 ${options.channels} 255 0 0 ${options.sampleRate}`
|
|
269
269
|
].join("\r\n") + "\r\n";
|
|
270
270
|
}
|
|
271
271
|
var RtspClient = class extends Connection {
|
|
@@ -563,10 +563,7 @@ var Statistics = class {
|
|
|
563
563
|
|
|
564
564
|
//#endregion
|
|
565
565
|
//#region src/const.ts
|
|
566
|
-
const MAX_PACKETS_COMPENSATE = 3;
|
|
567
566
|
const PACKET_BACKLOG_SIZE = 1e3;
|
|
568
|
-
const SLOW_WARNING_THRESHOLD = 5;
|
|
569
|
-
const FRAMES_PER_PACKET$1 = 352;
|
|
570
567
|
const MISSING_METADATA = {
|
|
571
568
|
title: "Streaming with apple-raop",
|
|
572
569
|
artist: "apple-raop",
|
|
@@ -715,8 +712,8 @@ var StreamClient = class extends EventEmitter {
|
|
|
715
712
|
if (numSent === 0) break;
|
|
716
713
|
stats.tick(numSent);
|
|
717
714
|
const framesBehind = stats.framesBehind;
|
|
718
|
-
if (framesBehind >=
|
|
719
|
-
const maxPackets = Math.min(Math.floor(framesBehind /
|
|
715
|
+
if (framesBehind >= 352) {
|
|
716
|
+
const maxPackets = Math.min(Math.floor(framesBehind / 352), 3);
|
|
720
717
|
this.#context.logger.debug(`Compensating with ${maxPackets} packets (${framesBehind} frames behind)`);
|
|
721
718
|
const [sentFrames, hasMorePackets] = await this.#sendNumberOfPackets(source, transport, maxPackets);
|
|
722
719
|
stats.tick(sentFrames);
|
|
@@ -734,7 +731,7 @@ var StreamClient = class extends EventEmitter {
|
|
|
734
731
|
await waitFor(diff * 1e3);
|
|
735
732
|
} else {
|
|
736
733
|
if (prevSlowSeqno === currentSeqno - 1) numberSlowSeqno++;
|
|
737
|
-
if (numberSlowSeqno >=
|
|
734
|
+
if (numberSlowSeqno >= 5) this.#context.logger.warn(`Too slow to keep up for seqno ${currentSeqno} (${absTimeStream.toFixed(3)} vs ${relToStart.toFixed(3)} => ${diff.toFixed(3)})`);
|
|
738
735
|
else this.#context.logger.debug(`Too slow to keep up for seqno ${currentSeqno} (${absTimeStream.toFixed(3)} vs ${relToStart.toFixed(3)} => ${diff.toFixed(3)})`);
|
|
739
736
|
prevSlowSeqno = currentSeqno;
|
|
740
737
|
}
|
|
@@ -744,7 +741,7 @@ var StreamClient = class extends EventEmitter {
|
|
|
744
741
|
}
|
|
745
742
|
async #sendPacket(source, firstPacket, transport) {
|
|
746
743
|
if (this.#streamContext.paddingSent >= this.#streamContext.latency) return 0;
|
|
747
|
-
let frames = await source.readFrames(
|
|
744
|
+
let frames = await source.readFrames(352);
|
|
748
745
|
if (!frames) {
|
|
749
746
|
frames = Buffer.alloc(this.#streamContext.packetSize);
|
|
750
747
|
this.#streamContext.paddingSent += Math.floor(frames.length / this.#streamContext.frameSize);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basmilius/apple-raop",
|
|
3
3
|
"description": "Implementation of Apple's RAOP protocol in Node.js.",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -46,12 +46,13 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@basmilius/apple-common": "0.9.
|
|
50
|
-
"@basmilius/apple-encoding": "0.9.
|
|
51
|
-
"@basmilius/apple-encryption": "0.9.
|
|
49
|
+
"@basmilius/apple-common": "0.9.15",
|
|
50
|
+
"@basmilius/apple-encoding": "0.9.15",
|
|
51
|
+
"@basmilius/apple-encryption": "0.9.15"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@types/bun": "^1.3.
|
|
55
|
-
"
|
|
54
|
+
"@types/bun": "^1.3.11",
|
|
55
|
+
"@types/node": "^25.5.0",
|
|
56
|
+
"tsdown": "^0.21.4"
|
|
56
57
|
}
|
|
57
58
|
}
|