Browse Source

Update AudioDataInit

master
guest271314 3 years ago
parent
commit
386a0b705e
No account linked to committer's email address
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      chromium_extension/AudioStream.js

+ 8
- 1
chromium_extension/AudioStream.js View File

}); });
buffer.getChannelData(0).set(floats); buffer.getChannelData(0).set(floats);
this.duration += buffer.duration; this.duration += buffer.duration;
const frame = new AudioData({ timestamp, buffer });
const frame = new AudioData({
format:'FLTP',
sampleRate: 22050,
numberOfChannels: 1,
numberOfFrames: 220,
timestamp,
data: buffer.getChannelData(0),
});
await this.audioWriter.write(frame); await this.audioWriter.write(frame);
if (this.recorder && this.recorder.state === 'inactive') { if (this.recorder && this.recorder.state === 'inactive') {
this.recorder.start(); this.recorder.start();

Loading…
Cancel
Save