mirror of
https://github.com/R0m1k3/EveFlow.git
synced 2026-10-11 17:29:03 +02:00
fix: resolve silent microphone issues by adding permission handlers and UI error notifications
This commit is contained in:
1 parent
c25875d8be
commit
6955721bdb
2 files changed
+17
-1
No files matched your search
@@ -267,6 +267,14 @@ app.whenReady().then(() => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Autoriser l'accès aux périphériques de capture (microphone) sous Electron
|
||||||
|
session.defaultSession.setPermissionRequestHandler((webContents, permission, callback) => {
|
||||||
|
if (permission === 'media') {
|
||||||
|
return callback(true);
|
||||||
|
}
|
||||||
|
callback(false);
|
||||||
|
});
|
||||||
|
|
||||||
startWebhookServer();
|
startWebhookServer();
|
||||||
createWindow();
|
createWindow();
|
||||||
|
|
||||||
|
|||||||
+9
-1
@@ -1606,12 +1606,18 @@ export const App: React.FC = () => {
|
|||||||
const handleStartVocalRecord = () => {
|
const handleStartVocalRecord = () => {
|
||||||
if (!audioServiceRef.current) return;
|
if (!audioServiceRef.current) return;
|
||||||
|
|
||||||
|
setErrorMessage(null);
|
||||||
audioServiceRef.current.stopSpeaking();
|
audioServiceRef.current.stopSpeaking();
|
||||||
setIsSpeaking(false);
|
setIsSpeaking(false);
|
||||||
|
|
||||||
audioServiceRef.current.startListening(
|
audioServiceRef.current.startListening(
|
||||||
(text) => {
|
(text) => {
|
||||||
handleSendMessage(text);
|
if (text.trim()) {
|
||||||
|
handleSendMessage(text);
|
||||||
|
} else {
|
||||||
|
setErrorMessage("Aucune parole n'a été détectée. Veuillez parler distinctement près du micro.");
|
||||||
|
setCurrentEmotion('sad');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
setIsListening(true);
|
setIsListening(true);
|
||||||
@@ -1622,6 +1628,8 @@ export const App: React.FC = () => {
|
|||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
setIsListening(false);
|
setIsListening(false);
|
||||||
|
setErrorMessage(`Erreur de reconnaissance vocale : ${err}`);
|
||||||
|
setCurrentEmotion('sad');
|
||||||
console.error(err);
|
console.error(err);
|
||||||
},
|
},
|
||||||
sttLang
|
sttLang
|
||||||
|
|||||||
Reference in new issue
Block a user