@vapi-ai/web 1.0.39 → 1.0.40
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.js +3 -6
- package/package.json +1 -1
- package/player.ts +4 -7
package/dist/player.js
CHANGED
|
@@ -23,18 +23,15 @@ class ContinuousPlayer extends events_1.default {
|
|
|
23
23
|
}
|
|
24
24
|
start() {
|
|
25
25
|
this.audio.play();
|
|
26
|
+
setInterval(() => {
|
|
27
|
+
console.log(this.audioQueue.length);
|
|
28
|
+
}, 1000);
|
|
26
29
|
}
|
|
27
30
|
playChunk(audioData) {
|
|
28
31
|
this.audioQueue.push(audioData);
|
|
29
32
|
this.appendNextChunk();
|
|
30
33
|
}
|
|
31
34
|
appendNextChunk() {
|
|
32
|
-
var _a;
|
|
33
|
-
console.log(`Current playing status: ${this.audio.paused ? "Paused" : "Playing"}`);
|
|
34
|
-
console.log(`Current playing status: ${this.audio.readyState}`);
|
|
35
|
-
console.log(this.audio);
|
|
36
|
-
console.log(`Buffered status: ${(_a = this.sourceBuffer) === null || _a === void 0 ? void 0 : _a.buffered.length}`);
|
|
37
|
-
console.log(`MediaSource readyState: ${this.mediaSource.readyState}`);
|
|
38
35
|
if (this.sourceBuffer &&
|
|
39
36
|
!this.sourceBuffer.updating &&
|
|
40
37
|
this.audioQueue.length > 0) {
|
package/package.json
CHANGED
package/player.ts
CHANGED
|
@@ -27,6 +27,10 @@ export class ContinuousPlayer extends EventEmitter {
|
|
|
27
27
|
|
|
28
28
|
start() {
|
|
29
29
|
this.audio.play();
|
|
30
|
+
|
|
31
|
+
setInterval(() => {
|
|
32
|
+
console.log(this.audioQueue.length);
|
|
33
|
+
}, 1000);
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
playChunk(audioData: ArrayBuffer) {
|
|
@@ -36,13 +40,6 @@ export class ContinuousPlayer extends EventEmitter {
|
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
private appendNextChunk(): void {
|
|
39
|
-
console.log(
|
|
40
|
-
`Current playing status: ${this.audio.paused ? "Paused" : "Playing"}`
|
|
41
|
-
);
|
|
42
|
-
console.log(`Current playing status: ${this.audio.readyState}`);
|
|
43
|
-
console.log(this.audio);
|
|
44
|
-
console.log(`Buffered status: ${this.sourceBuffer?.buffered.length}`);
|
|
45
|
-
console.log(`MediaSource readyState: ${this.mediaSource.readyState}`);
|
|
46
43
|
if (
|
|
47
44
|
this.sourceBuffer &&
|
|
48
45
|
!this.sourceBuffer.updating &&
|