Skip to content

Commit

Permalink
fix: resolve "data" callback audio incorrect issue
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 8, 2024
1 parent 2b963fc commit c20a079
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/_common/src/real-time-vad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class RealTimeVAD extends EventEmitter {
} else if (this.inputType === "buffer") {
const buffer = Buffer.alloc(audio.length * 2)
for (let i = 0; i < audio.length; i++) {
buffer.writeInt16LE(Math.floor(audio[i] ?? 0 * 32767), i * 2)
buffer.writeInt16LE(Math.floor(audio[i] * 32767), i * 2)
}
return buffer
}
Expand Down

0 comments on commit c20a079

Please sign in to comment.