@vapi-ai/web 1.0.100 → 1.0.102

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 CHANGED
@@ -33,6 +33,7 @@ class ContinuousPlayer extends events_1.default {
33
33
  this.audio.play();
34
34
  }
35
35
  playChunk(audioData) {
36
+ console.log("playChunk");
36
37
  this.operationsQueue.push(() => this.appendNextChunk(audioData));
37
38
  }
38
39
  performBufferOperation(operation) {
@@ -58,6 +59,7 @@ class ContinuousPlayer extends events_1.default {
58
59
  return this.performBufferOperation(() => {
59
60
  if (!this.sourceBuffer)
60
61
  return;
62
+ console.log("appending");
61
63
  this.sourceBuffer.appendBuffer(chunk);
62
64
  });
63
65
  }
package/dist/vapi.js CHANGED
@@ -54,7 +54,7 @@ class Vapi extends events_1.default {
54
54
  startRecording() {
55
55
  navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
56
56
  this.mediaRecorder = new MediaRecorder(stream, {
57
- mimeType: "audio/webm",
57
+ mimeType: "audio/webm;codecs=opus",
58
58
  });
59
59
  this.mediaRecorder.start(100);
60
60
  this.mediaRecorder.ondataavailable = (event) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vapi-ai/web",
3
- "version": "1.0.100",
3
+ "version": "1.0.102",
4
4
  "description": "",
5
5
  "main": "dist/vapi.js",
6
6
  "types": "dist/vapi.d.ts",
package/player.ts CHANGED
@@ -44,6 +44,7 @@ export class ContinuousPlayer extends EventEmitter {
44
44
  }
45
45
 
46
46
  playChunk(audioData: ArrayBuffer) {
47
+ console.log("playChunk");
47
48
  this.operationsQueue.push(() => this.appendNextChunk(audioData));
48
49
  }
49
50
 
@@ -76,6 +77,8 @@ export class ContinuousPlayer extends EventEmitter {
76
77
  private appendNextChunk(chunk: ArrayBuffer) {
77
78
  return this.performBufferOperation(() => {
78
79
  if (!this.sourceBuffer) return;
80
+ console.log("appending");
81
+
79
82
  this.sourceBuffer.appendBuffer(chunk);
80
83
  });
81
84
  }
package/vapi.ts CHANGED
@@ -59,7 +59,7 @@ export default class Vapi extends EventEmitter {
59
59
  private startRecording(): void {
60
60
  navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
61
61
  this.mediaRecorder = new MediaRecorder(stream, {
62
- mimeType: "audio/webm",
62
+ mimeType: "audio/webm;codecs=opus",
63
63
  });
64
64
 
65
65
  this.mediaRecorder.start(100);