[mirotalk] - add silenceThreshold

This commit is contained in:
Miroslav Pejic
2025-07-10 09:16:48 +02:00
parent ec0ce96490
commit 31433165d4
7 changed files with 16 additions and 12 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.28
* @version 1.5.29
*
*/
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "mirotalk",
"version": "1.5.28",
"version": "1.5.29",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mirotalk",
"version": "1.5.28",
"version": "1.5.29",
"license": "AGPL-3.0",
"dependencies": {
"@mattermost/client": "10.8.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mirotalk",
"version": "1.5.28",
"version": "1.5.29",
"description": "A free WebRTC browser-based video call",
"main": "server.js",
"scripts": {
+1 -1
View File
@@ -73,7 +73,7 @@ let brand = {
},
about: {
imageUrl: '../images/mirotalk-logo.gif',
title: 'WebRTC P2P v1.5.28',
title: 'WebRTC P2P v1.5.29',
html: `
<button
id="support-button"
+2 -2
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.28
* @version 1.5.29
*
*/
@@ -11240,7 +11240,7 @@ function showAbout() {
Swal.fire({
background: swBg,
position: 'center',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.5.28',
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.5.29',
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
customClass: { image: 'img-about' },
html: `
+2 -1
View File
@@ -31,9 +31,10 @@ async function getMicrophoneVolumeIndicator(stream) {
await audioContext.audioWorklet.addModule('/js/volumeProcessor.js');
workletNode = new AudioWorkletNode(audioContext, 'volume-processor', {
processorOptions: {
threshold: 10, // Volume threshold
peerId: myPeerId, // Your peer ID
myAudioStatus: myAudioStatus, // Your audio status
threshold: 10, // Volume threshold
silenceThreshold: 0.01, // Silence threshold
},
});
+7 -4
View File
@@ -5,6 +5,7 @@ class VolumeProcessor extends AudioWorkletProcessor {
this.threshold = options.processorOptions.threshold || 10;
this.peerId = options.processorOptions.peerId || '';
this.myAudioStatus = options.processorOptions.myAudioStatus || false;
this.silenceThreshold = options.processorOptions.silenceThreshold || 0.01;
}
process(inputs, outputs, parameters) {
@@ -41,10 +42,12 @@ class VolumeProcessor extends AudioWorkletProcessor {
}
// Send volume data for UI updates
this.port.postMessage({
type: 'volumeIndicator',
volume: volume,
});
if (volume > this.silenceThreshold) {
this.port.postMessage({
type: 'volumeIndicator',
volume: volume,
});
}
return true;
}