fix: ts error
This commit is contained in:
parent
4988d2ee26
commit
88cd3ac122
|
@ -54,6 +54,7 @@ export class AudioHandler {
|
||||||
const uint8Data = new Uint8Array(int16Data.buffer);
|
const uint8Data = new Uint8Array(int16Data.buffer);
|
||||||
onChunk(uint8Data);
|
onChunk(uint8Data);
|
||||||
// save recordBuffer
|
// save recordBuffer
|
||||||
|
// @ts-ignore
|
||||||
this.recordBuffer.push.apply(this.recordBuffer, int16Data);
|
this.recordBuffer.push.apply(this.recordBuffer, int16Data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -95,6 +96,7 @@ export class AudioHandler {
|
||||||
if (!this.isPlaying) return;
|
if (!this.isPlaying) return;
|
||||||
|
|
||||||
const int16Data = new Int16Array(chunk.buffer);
|
const int16Data = new Int16Array(chunk.buffer);
|
||||||
|
// @ts-ignore
|
||||||
this.playBuffer.push.apply(this.playBuffer, int16Data); // save playBuffer
|
this.playBuffer.push.apply(this.playBuffer, int16Data); // save playBuffer
|
||||||
|
|
||||||
const float32Data = new Float32Array(int16Data.length);
|
const float32Data = new Float32Array(int16Data.length);
|
||||||
|
@ -155,6 +157,7 @@ export class AudioHandler {
|
||||||
return new Blob([view, data.buffer], { type: "audio/mpeg" });
|
return new Blob([view, data.buffer], { type: "audio/mpeg" });
|
||||||
}
|
}
|
||||||
savePlayFile() {
|
savePlayFile() {
|
||||||
|
// @ts-ignore
|
||||||
return this._saveData(new Int16Array(this.playBuffer));
|
return this._saveData(new Int16Array(this.playBuffer));
|
||||||
}
|
}
|
||||||
saveRecordFile(
|
saveRecordFile(
|
||||||
|
@ -168,6 +171,7 @@ export class AudioHandler {
|
||||||
? Math.floor((audioEndMillis * this.sampleRate) / 1000)
|
? Math.floor((audioEndMillis * this.sampleRate) / 1000)
|
||||||
: this.recordBuffer.length;
|
: this.recordBuffer.length;
|
||||||
return this._saveData(
|
return this._saveData(
|
||||||
|
// @ts-ignore
|
||||||
new Int16Array(this.recordBuffer.slice(startIndex, endIndex)),
|
new Int16Array(this.recordBuffer.slice(startIndex, endIndex)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue