- Joined
- Sep 12, 2022
- Messages
- 2
- Reaction score
- 0
async function record(stream, ms) {
const rec = new MediaRecorder(stream), data = [];
rec.ondataavailable = e => data.push(e.data);
rec.start();
const stopped = new Promise((resolve, reject) => {
rec.onstop = resolve;
rec.onerror = e => reject(e.error);
});
await Promise.all([stopped, wait(ms).then(() => rec.stop())]);
return new Blob(data, { type: data[0].type });
}
The above code, is not recording the audio stream. someone help is great
const rec = new MediaRecorder(stream), data = [];
rec.ondataavailable = e => data.push(e.data);
rec.start();
const stopped = new Promise((resolve, reject) => {
rec.onstop = resolve;
rec.onerror = e => reject(e.error);
});
await Promise.all([stopped, wait(ms).then(() => rec.stop())]);
return new Blob(data, { type: data[0].type });
}
The above code, is not recording the audio stream. someone help is great