Skip to content

Commit

Permalink
fix: ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogtiti committed Nov 7, 2024
1 parent 4988d2e commit 88cd3ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/lib/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class AudioHandler {
const uint8Data = new Uint8Array(int16Data.buffer);
onChunk(uint8Data);
// save recordBuffer
// @ts-ignore
this.recordBuffer.push.apply(this.recordBuffer, int16Data);
}
};
Expand Down Expand Up @@ -95,6 +96,7 @@ export class AudioHandler {
if (!this.isPlaying) return;

const int16Data = new Int16Array(chunk.buffer);
// @ts-ignore
this.playBuffer.push.apply(this.playBuffer, int16Data); // save playBuffer

const float32Data = new Float32Array(int16Data.length);
Expand Down Expand Up @@ -155,6 +157,7 @@ export class AudioHandler {
return new Blob([view, data.buffer], { type: "audio/mpeg" });
}
savePlayFile() {
// @ts-ignore
return this._saveData(new Int16Array(this.playBuffer));
}
saveRecordFile(
Expand All @@ -168,6 +171,7 @@ export class AudioHandler {
? Math.floor((audioEndMillis * this.sampleRate) / 1000)
: this.recordBuffer.length;
return this._saveData(
// @ts-ignore
new Int16Array(this.recordBuffer.slice(startIndex, endIndex)),
);
}
Expand Down

0 comments on commit 88cd3ac

Please sign in to comment.