From 2859818759e377bf1e916a1f6bd1ee4c1e505970 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Fri, 31 May 2024 13:40:48 +0200 Subject: [PATCH] [mirotalksfu] - improvements --- public/js/RoomClient.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index a6186a84..0df9934f 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -3709,7 +3709,9 @@ class RoomClient { this.appendMessage('right', image.chatgpt, 'ChatGPT', this.peer_id, message, 'ChatGPT', 'ChatGPT'); this.cleanMessage(); this.streamingTask(message); // Video AI avatar speak - this.speechInMessages ? this.speechMessage(true, 'ChatGPT', message) : this.sound('message'); + this.speechInMessages && !VideoAI.active + ? this.speechMessage(true, 'ChatGPT', message) + : this.sound('message'); }) .catch((err) => { console.log('ChatGPT error:', err); @@ -3804,8 +3806,14 @@ class RoomClient { if (!this.showChatOnMessage) { this.userLog('info', `💬 New message from: ${data.peer_name}`, 'top-end'); } - this.speechInMessages ? this.speechMessage(true, data.peer_name, data.peer_msg) : this.sound('message'); - //this.speechInMessages ? this.streamingTask(data.peer_msg) : this.sound('message'); + + if (this.speechInMessages) { + VideoAI.active + ? this.streamingTask(`New message from: ${data.peer_name}, the message is: ${data.peer_msg}`) + : this.speechMessage(true, data.peer_name, data.peer_msg); + } else { + this.sound('message'); + } const participantsList = this.getId('participantsList'); const participantsListItems = participantsList.getElementsByTagName('li');