added voice functionality and increased avatar size
All checks were successful
Deploy FluentGerman.ai / deploy (push) Successful in 53s

This commit is contained in:
2026-02-18 10:11:13 +01:00
parent 6df7b17261
commit be366777d4
7 changed files with 59 additions and 11 deletions

View File

@@ -199,8 +199,19 @@ class VoiceManager {
const audioBlob = await response.blob();
const audioUrl = URL.createObjectURL(audioBlob);
const audio = new Audio(audioUrl);
// Visual feedback
const avatarContainer = document.querySelector('.avatar-container');
if (avatarContainer) avatarContainer.classList.add('speaking');
await audio.play();
return new Promise(resolve => { audio.onended = resolve; });
return new Promise(resolve => {
audio.onended = () => {
if (avatarContainer) avatarContainer.classList.remove('speaking');
resolve();
};
});
}
} catch (e) {
console.warn('[Voice] API TTS failed:', e);