@vapi-ai/web 1.0.93 → 1.0.95
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/player.d.ts +0 -1
- package/dist/player.js +3 -10
- package/package.json +1 -1
- package/player.ts +8 -10
package/dist/player.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export declare class ContinuousPlayer extends EventEmitter {
|
|
|
10
10
|
playChunk(audioData: ArrayBuffer): void;
|
|
11
11
|
private performBufferOperation;
|
|
12
12
|
private appendNextChunk;
|
|
13
|
-
private removeBufferedRange;
|
|
14
13
|
private removeBuffer;
|
|
15
14
|
private resetTimestampOffset;
|
|
16
15
|
private abortBuffer;
|
package/dist/player.js
CHANGED
|
@@ -67,19 +67,12 @@ class ContinuousPlayer extends events_1.default {
|
|
|
67
67
|
this.sourceBuffer.appendBuffer(chunk);
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
removeBufferedRange() {
|
|
71
|
-
return this.performBufferOperation(() => {
|
|
72
|
-
if (!this.sourceBuffer)
|
|
73
|
-
return;
|
|
74
|
-
this.sourceBuffer.remove(0, this.sourceBuffer.buffered.end(0));
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
70
|
removeBuffer() {
|
|
78
|
-
return
|
|
71
|
+
return this.performBufferOperation(() => {
|
|
79
72
|
if (!this.sourceBuffer)
|
|
80
73
|
return;
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
if (this.sourceBuffer.buffered.length > 0) {
|
|
75
|
+
this.sourceBuffer.remove(0, this.sourceBuffer.buffered.end(this.sourceBuffer.buffered.length - 1));
|
|
83
76
|
}
|
|
84
77
|
});
|
|
85
78
|
}
|
package/package.json
CHANGED
package/player.ts
CHANGED
|
@@ -76,19 +76,17 @@ export class ContinuousPlayer extends EventEmitter {
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
private
|
|
79
|
+
private removeBuffer() {
|
|
80
80
|
return this.performBufferOperation(() => {
|
|
81
81
|
if (!this.sourceBuffer) return;
|
|
82
|
-
this.sourceBuffer.remove(0, this.sourceBuffer.buffered.end(0));
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
private async removeBuffer() {
|
|
87
|
-
if (!this.sourceBuffer) return;
|
|
88
82
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
if (this.sourceBuffer.buffered.length > 0) {
|
|
84
|
+
this.sourceBuffer.remove(
|
|
85
|
+
0,
|
|
86
|
+
this.sourceBuffer.buffered.end(this.sourceBuffer.buffered.length - 1)
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
private resetTimestampOffset() {
|