[mirotalk] - #309 Detect low quality Bluetooth headsets, update dep

This commit is contained in:
Miroslav Pejic
2025-10-24 21:46:38 +02:00
parent 5a01b91d92
commit f0bb19d3fb
5 changed files with 77 additions and 66 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ dependencies: {
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.81
* @version 1.5.82
*
*/
+29 -29
View File
@@ -1,17 +1,17 @@
{
"name": "mirotalk",
"version": "1.5.81",
"version": "1.5.82",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mirotalk",
"version": "1.5.81",
"version": "1.5.82",
"license": "AGPL-3.0",
"dependencies": {
"@mattermost/client": "10.12.0",
"@ngrok/ngrok": "1.5.2",
"@sentry/node": "^10.21.0",
"@sentry/node": "^10.22.0",
"axios": "^1.12.2",
"chokidar": "^4.0.3",
"colors": "^1.4.0",
@@ -28,8 +28,8 @@
"js-yaml": "^4.1.0",
"jsdom": "^27.0.1",
"jsonwebtoken": "^9.0.2",
"nodemailer": "^7.0.9",
"openai": "^6.6.0",
"nodemailer": "^7.0.10",
"openai": "^6.7.0",
"qs": "^6.14.0",
"socket.io": "^4.8.1",
"swagger-ui-express": "^5.0.1",
@@ -1158,18 +1158,18 @@
"license": "Apache-2.0"
},
"node_modules/@sentry/core": {
"version": "10.21.0",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.21.0.tgz",
"integrity": "sha512-/+gpOOb2Wr1UbW59WKqNAVVIqFz9FjtUJuPtVh4UanxGCfavMPaKpFzSlaEKJSKDkiCQgANP4O2y8Y5Bh3tvEA==",
"version": "10.22.0",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.22.0.tgz",
"integrity": "sha512-V1oeHbrOKzxadsCmgtPku3v3Emo/Bpb3VSuKmlLrQefiHX98MWtjJ3XDGfduzD5/dCdh0r/OOLwjcmrO/PZ2aw==",
"license": "MIT",
"engines": {
"node": ">=18"
}
},
"node_modules/@sentry/node": {
"version": "10.21.0",
"resolved": "https://registry.npmjs.org/@sentry/node/-/node-10.21.0.tgz",
"integrity": "sha512-z7g+rZIHOSzISGCYbpy8b6UxYd7kl0bjdTTjDC4rJCoofhO71By5tZum1HhcmYEWWDj7qc/Mbfmfv6rXoimT6A==",
"version": "10.22.0",
"resolved": "https://registry.npmjs.org/@sentry/node/-/node-10.22.0.tgz",
"integrity": "sha512-PfG8AMT2kgFJ7rWb0lLJOmjLW2riytTliLMjfoJ8/tLGk964uKqE0xM7FLtXZjlLJqTXVYCVG7VIPj185uyckQ==",
"license": "MIT",
"dependencies": {
"@opentelemetry/api": "^1.9.0",
@@ -1202,9 +1202,9 @@
"@opentelemetry/sdk-trace-base": "^2.1.0",
"@opentelemetry/semantic-conventions": "^1.37.0",
"@prisma/instrumentation": "6.15.0",
"@sentry/core": "10.21.0",
"@sentry/node-core": "10.21.0",
"@sentry/opentelemetry": "10.21.0",
"@sentry/core": "10.22.0",
"@sentry/node-core": "10.22.0",
"@sentry/opentelemetry": "10.22.0",
"import-in-the-middle": "^1.14.2",
"minimatch": "^9.0.0"
},
@@ -1213,14 +1213,14 @@
}
},
"node_modules/@sentry/node-core": {
"version": "10.21.0",
"resolved": "https://registry.npmjs.org/@sentry/node-core/-/node-core-10.21.0.tgz",
"integrity": "sha512-vPn9sYMl2IB14lp6HP3nyJVM2VDDpclf7yvNWe/9yDY+ad1T/+8x5j501LjUaZDRR+7APM1Mb1S9YMAL3gTiwA==",
"version": "10.22.0",
"resolved": "https://registry.npmjs.org/@sentry/node-core/-/node-core-10.22.0.tgz",
"integrity": "sha512-88Yyn+Qvmp0kPMnNRWgpUlAvhI9CNPqOT+0glW0L7OoN8LkJcNgx2GGUoLrJ+RGeHz/S7dIJY6DGa+u0Not2Qg==",
"license": "MIT",
"dependencies": {
"@apm-js-collab/tracing-hooks": "^0.3.1",
"@sentry/core": "10.21.0",
"@sentry/opentelemetry": "10.21.0",
"@sentry/core": "10.22.0",
"@sentry/opentelemetry": "10.22.0",
"import-in-the-middle": "^1.14.2"
},
"engines": {
@@ -1237,12 +1237,12 @@
}
},
"node_modules/@sentry/opentelemetry": {
"version": "10.21.0",
"resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-10.21.0.tgz",
"integrity": "sha512-Yr4imXxkSLhJt2WHVXh31NpIe9ZgcnJTVVvzq/g6Ox40bj5+cdpFh6RTsLcsw5hvDC8a1KUvmdIhUTKAkEsqgA==",
"version": "10.22.0",
"resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-10.22.0.tgz",
"integrity": "sha512-XHXYYq3zsQ/dj1kQ7cGGLFIEVRmrmjcMhiJHvmKKsUGKxQjHe2G0LuG8clHIPkmbg7yEIxCT/W2I9QzrwYt5+g==",
"license": "MIT",
"dependencies": {
"@sentry/core": "10.21.0"
"@sentry/core": "10.22.0"
},
"engines": {
"node": ">=18"
@@ -3990,9 +3990,9 @@
}
},
"node_modules/nodemailer": {
"version": "7.0.9",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.9.tgz",
"integrity": "sha512-9/Qm0qXIByEP8lEV2qOqcAW7bRpL8CR9jcTwk3NBnHJNmP9fIJ86g2fgmIXqHY+nj55ZEMwWqYAT2QTDpRUYiQ==",
"version": "7.0.10",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-7.0.10.tgz",
"integrity": "sha512-Us/Se1WtT0ylXgNFfyFSx4LElllVLJXQjWi2Xz17xWw7amDKO2MLtFnVp1WACy7GkVGs+oBlRopVNUzlrGSw1w==",
"license": "MIT-0",
"engines": {
"node": ">=6.0.0"
@@ -4229,9 +4229,9 @@
}
},
"node_modules/openai": {
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/openai/-/openai-6.6.0.tgz",
"integrity": "sha512-1yWk4cBsHF5Bq9TreHYOHY7pbqdlT74COnm8vPx7WKn36StS+Hyk8DdAitnLaw67a5Cudkz5EmlFQjSrNnrA2w==",
"version": "6.7.0",
"resolved": "https://registry.npmjs.org/openai/-/openai-6.7.0.tgz",
"integrity": "sha512-mgSQXa3O/UXTbA8qFzoa7aydbXBJR5dbLQXCRapAOtoNT+v69sLdKMZzgiakpqhclRnhPggPAXoniVGn2kMY2A==",
"license": "Apache-2.0",
"bin": {
"openai": "bin/cli"
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "mirotalk",
"version": "1.5.81",
"version": "1.5.82",
"description": "A free WebRTC browser-based video call",
"main": "server.js",
"scripts": {
@@ -43,7 +43,7 @@
"dependencies": {
"@mattermost/client": "10.12.0",
"@ngrok/ngrok": "1.5.2",
"@sentry/node": "^10.21.0",
"@sentry/node": "^10.22.0",
"axios": "^1.12.2",
"chokidar": "^4.0.3",
"colors": "^1.4.0",
@@ -60,8 +60,8 @@
"jsdom": "^27.0.1",
"jsonwebtoken": "^9.0.2",
"js-yaml": "^4.1.0",
"nodemailer": "^7.0.9",
"openai": "^6.6.0",
"nodemailer": "^7.0.10",
"openai": "^6.7.0",
"qs": "^6.14.0",
"socket.io": "^4.8.1",
"swagger-ui-express": "^5.0.1",
+1 -1
View File
@@ -75,7 +75,7 @@ let brand = {
},
about: {
imageUrl: '../images/mirotalk-logo.gif',
title: 'WebRTC P2P v1.5.81',
title: 'WebRTC P2P v1.5.82',
html: `
<button
id="support-button"
+42 -31
View File
@@ -15,7 +15,7 @@
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.81
* @version 1.5.82
*
*/
@@ -2930,37 +2930,48 @@ async function initEnumerateVideoDevices() {
* @param {object} stream
*/
async function enumerateAudioDevices(stream) {
console.log('06. Get Audio Devices');
await navigator.mediaDevices
.enumerateDevices()
.then((devices) =>
devices.forEach(async (device) => {
let el,
eli = null;
if ('audioinput' === device.kind) {
el = audioInputSelect;
eli = initMicrophoneSelect;
lS.DEVICES_COUNT.audio++;
} else if ('audiooutput' === device.kind) {
el = audioOutputSelect;
eli = initSpeakerSelect;
lS.DEVICES_COUNT.speaker++;
}
if (!el) return;
await addChild(device, [el, eli]);
})
)
.then(async () => {
await stopTracks(stream);
isEnumerateAudioDevices = true;
//const sinkId = 'sinkId' in HTMLMediaElement.prototype;
audioOutputSelect.disabled = !sinkId;
// Check if there is speakers
if (!sinkId || initSpeakerSelect.options.length === 0) {
elemDisplay(initSpeakerSelect, false);
elemDisplay(audioOutputDiv, false);
try {
const devices = await navigator.mediaDevices.enumerateDevices();
// Detect presence of potentially low-quality Bluetooth headsets
const hasLowQualityBT = devices.some(
(d) => d.kind === 'audioinput' && /(bluetooth|headset|hands[- ]?free|hsp|hfp|sco|airpods)/i.test(d.label)
);
if (hasLowQualityBT) {
alert(
'⚠️ Youre using a Bluetooth headset with limited audio quality. For best results, use your devices built-in microphone or a wired headset.'
);
}
// Populate selects and counts
devices.forEach(async (device) => {
console.log('enumerateAudioDevices', device.label);
let el,
eli = null;
if ('audioinput' === device.kind) {
el = audioInputSelect;
eli = initMicrophoneSelect;
lS.DEVICES_COUNT.audio++;
} else if ('audiooutput' === device.kind) {
el = audioOutputSelect;
eli = initSpeakerSelect;
lS.DEVICES_COUNT.speaker++;
}
if (!el) return;
await addChild(device, [el, eli]);
});
await stopTracks(stream);
isEnumerateAudioDevices = true;
audioOutputSelect.disabled = !sinkId;
// Check if there is speakers
if (!sinkId || initSpeakerSelect.options.length === 0) {
elemDisplay(initSpeakerSelect, false);
elemDisplay(audioOutputDiv, false);
}
} catch (err) {
console.error('enumerateAudioDevices error', err);
}
}
/**
@@ -11453,7 +11464,7 @@ function showAbout() {
Swal.fire({
background: swBg,
position: 'center',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.5.81',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.5.82',
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
customClass: { image: 'img-about' },
html: `