mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 13:55:19 +00:00
refac: voice recording
This commit is contained in:
parent
79dff685ea
commit
40a3e7786b
1 changed files with 4 additions and 1 deletions
|
|
@ -159,7 +159,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const startRecording = async () => {
|
const startRecording = async () => {
|
||||||
startDurationCounter();
|
loading = true;
|
||||||
|
|
||||||
stream = await navigator.mediaDevices.getUserMedia({
|
stream = await navigator.mediaDevices.getUserMedia({
|
||||||
audio: {
|
audio: {
|
||||||
|
|
@ -171,6 +171,9 @@
|
||||||
mediaRecorder = new MediaRecorder(stream);
|
mediaRecorder = new MediaRecorder(stream);
|
||||||
mediaRecorder.onstart = () => {
|
mediaRecorder.onstart = () => {
|
||||||
console.log('Recording started');
|
console.log('Recording started');
|
||||||
|
loading = false;
|
||||||
|
startDurationCounter();
|
||||||
|
|
||||||
audioChunks = [];
|
audioChunks = [];
|
||||||
analyseAudio(stream);
|
analyseAudio(stream);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue