macos #1

Merged
benoit merged 8 commits from macos into main 2026-06-18 16:20:06 +02:00
4 changed files with 26 additions and 10 deletions
Showing only changes of commit 9aff58c528 - Show all commits
+1 -1
View File
@@ -81,7 +81,7 @@ define(['./workbox-290dd570'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812" "revision": "3ca0b8505b4bec776b69afdba2768812"
}, { }, {
"url": "index.html", "url": "index.html",
"revision": "0.0p0vks93ec8" "revision": "0.rol69f8gtdg"
}], {}); }], {});
workbox.cleanupOutdatedCaches(); workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
File diff suppressed because one or more lines are too long
+20 -2
View File
@@ -216,6 +216,21 @@ export class GroupAudioRouter extends EventEmitter {
this.groupBuffers.set(groupId, new Float32Array(this.config.frameSize)); this.groupBuffers.set(groupId, new Float32Array(this.config.frameSize));
}); });
// Compter le nombre de sources par groupe pour normalisation
const groupSourceCount = new Map();
inputChannelsData.forEach((_, channelId) => {
const key = `in_${channelId}`;
const routes = this.inputToGroupRoutes.get(key);
if (routes) {
routes.forEach(route => {
groupSourceCount.set(
route.destination,
(groupSourceCount.get(route.destination) || 0) + 1
);
});
}
});
// Pour chaque canal d'entrée // Pour chaque canal d'entrée
inputChannelsData.forEach((pcmData, channelId) => { inputChannelsData.forEach((pcmData, channelId) => {
const key = `in_${channelId}`; const key = `in_${channelId}`;
@@ -234,9 +249,12 @@ export class GroupAudioRouter extends EventEmitter {
return; return;
} }
// Mixage avec gain // Mixage avec gain + atténuation par nombre de sources
const sourceCount = groupSourceCount.get(route.destination) || 1;
const mixGain = route.linearGain / sourceCount;
for (let i = 0; i < pcmData.length && i < groupBuffer.length; i++) { for (let i = 0; i < pcmData.length && i < groupBuffer.length; i++) {
groupBuffer[i] += pcmData[i] * route.linearGain; groupBuffer[i] += pcmData[i] * mixGain;
} }
}); });
}); });
+4 -6
View File
@@ -191,19 +191,17 @@ export class CoreAudioBackend extends EventEmitter {
const args = []; const args = [];
// Spécifier le device d'entrée // Spécifier le device d'entrée (CoreAudio capture en 32-bit natif)
if (this.options.inputDeviceName) { if (this.options.inputDeviceName) {
// Utiliser le device spécifié par son nom
args.push('-t', 'coreaudio', this.options.inputDeviceName); args.push('-t', 'coreaudio', this.options.inputDeviceName);
} else { } else {
// Device par défaut
args.push('-d'); args.push('-d');
} }
// Format de sortie (stdout) // Format de sortie (stdout) - convertir 32→16 bit
args.push( args.push(
'-t', 'raw', '-t', 'raw', // Format sortie raw PCM
'-b', '16', '-b', '16', // Convertir vers 16-bit
'-e', 'signed-integer', '-e', 'signed-integer',
'-c', String(this.options.channels), '-c', String(this.options.channels),
'-r', String(this.options.sampleRate), '-r', String(this.options.sampleRate),