mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 13:38:47 +00:00
Remove AudioBuffer use AudioData
This commit is contained in:
@@ -221,21 +221,15 @@ class AudioStream {
|
||||
int >= 0x8000 ? -(0x10000 - int) / 0x8000 : int / 0x7fff;
|
||||
floats[i] = float;
|
||||
}
|
||||
const buffer = new AudioBuffer({
|
||||
numberOfChannels: this.numberOfChannels,
|
||||
length: floats.length,
|
||||
sampleRate: this.sampleRate,
|
||||
});
|
||||
buffer.getChannelData(0).set(floats);
|
||||
this.duration += buffer.duration;
|
||||
const frame = new AudioData({
|
||||
format: 'FLTP',
|
||||
sampleRate: 22050,
|
||||
numberOfChannels: 1,
|
||||
numberOfFrames: 220,
|
||||
timestamp,
|
||||
data: buffer.getChannelData(0),
|
||||
data: floats,
|
||||
});
|
||||
this.duration += (frame.duration / 10**6);
|
||||
if (this.recorder && this.recorder.state === 'inactive') {
|
||||
this.recorder.start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user