Skip to content

Commit

Permalink
[mirotalksfu] - Fix rec, update dep
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed May 30, 2024
1 parent 3a50fe1 commit 1cdc526
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies: {
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.4.40
* @version 1.4.41
*
*/

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirotalksfu",
"version": "1.4.40",
"version": "1.4.41",
"description": "WebRTC SFU browser-based video calls",
"main": "Server.js",
"scripts": {
Expand Down Expand Up @@ -57,7 +57,7 @@
"mediasoup-client": "3.7.8",
"ngrok": "^5.0.0-beta.2",
"nodemailer": "^6.9.13",
"openai": "^4.47.1",
"openai": "^4.47.2",
"qs": "6.12.1",
"socket.io": "4.7.5",
"swagger-ui-express": "5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion public/js/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.4.40
* @version 1.4.41
*
*/

Expand Down
26 changes: 16 additions & 10 deletions public/js/RoomClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.4.40
* @version 1.4.41
*
*/

Expand Down Expand Up @@ -4304,9 +4304,12 @@ class RoomClient {
const audioElements = document.querySelectorAll('audio');
const audioTracks = [];
audioElements.forEach((audio) => {
const audioTrack = audio.srcObject.getAudioTracks()[0];
if (audioTrack) {
audioTracks.push(audioTrack);
// Exclude avatar Preview Audio
if (audio.id !== 'avatarPreviewAudio') {
const audioTrack = audio.srcObject.getAudioTracks()[0];
if (audioTrack) {
audioTracks.push(audioTrack);
}
}
});
return audioTracks;
Expand All @@ -4316,9 +4319,12 @@ class RoomClient {
const audioElements = document.querySelectorAll('audio');
const audioStream = new MediaStream();
audioElements.forEach((audio) => {
const audioTrack = audio.srcObject.getAudioTracks()[0];
if (audioTrack) {
audioStream.addTrack(audioTrack);
// Exclude avatar Preview Audio
if (audio.id !== 'avatarPreviewAudio') {
const audioTrack = audio.srcObject.getAudioTracks()[0];
if (audioTrack) {
audioStream.addTrack(audioTrack);
}
}
});
return audioStream;
Expand Down Expand Up @@ -6934,9 +6940,9 @@ class RoomClient {
)?.preview?.movio;
VideoAI.avatarVoice = selectedVoiceID;
if (selectedPreviewURL) {
const previewAudio = document.getElementById('previewAudio');
previewAudio.src = selectedPreviewURL;
previewAudio.play();
const avatarPreviewAudio = document.getElementById('avatarPreviewAudio');
avatarPreviewAudio.src = selectedPreviewURL;
avatarPreviewAudio.play();
}
});
})
Expand Down
2 changes: 1 addition & 1 deletion public/views/Room.html
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ <h1>Loading</h1>
<option value="">Select Avatar Voice</option></select
><br /><br />
<div id="audio-container">
<audio id="previewAudio" controls></audio>
<audio id="avatarPreviewAudio" controls></audio>
</div>
</div>
<br />
Expand Down

0 comments on commit 1cdc526

Please sign in to comment.