added visual waiting steps
All checks were successful
Deploy FluentGerman.ai / deploy (push) Successful in 52s
All checks were successful
Deploy FluentGerman.ai / deploy (push) Successful in 52s
This commit is contained in:
@@ -147,6 +147,8 @@ class VoiceManager {
|
||||
stopRecording() {
|
||||
if (this.mode === 'api') {
|
||||
if (this.mediaRecorder?.state === 'recording') {
|
||||
// Show processing state immediately (don't wait for onstop callback)
|
||||
if (this.onProcessing) this.onProcessing(true);
|
||||
this.mediaRecorder.stop();
|
||||
} else {
|
||||
this.isRecording = false;
|
||||
@@ -240,17 +242,20 @@ class VoiceManager {
|
||||
return new Promise(resolve => {
|
||||
audio.onended = () => {
|
||||
if (avatarContainer) avatarContainer.classList.remove('speaking');
|
||||
URL.revokeObjectURL(audioUrl);
|
||||
resolve();
|
||||
};
|
||||
// Handle errors during playback (e.g. format issues)
|
||||
audio.onerror = () => {
|
||||
if (avatarContainer) avatarContainer.classList.remove('speaking');
|
||||
URL.revokeObjectURL(audioUrl);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.error("Playback failed", e);
|
||||
if (avatarContainer) avatarContainer.classList.remove('speaking');
|
||||
URL.revokeObjectURL(audioUrl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user