feat: mode écoute seule pour les server audio users (Master par groupe)
Un participant serveur peut être configuré sans publier de micro — il reçoit le mix du groupe et le sort sur un canal physique. - ServerAudioUser: flag publish (défaut true), sendAudio no-op si false - AudioBridgeManager: canPublish LiveKit selon flag, input_channel null si écoute - AudioBridge: passe publish à ServerAudioUser, log adapté - Electron UI: checkbox "Écoute seule" dans add/edit, badges 🎤/👂 dans table - main.js IPC: persist publish + input_channel null en écoute
This commit is contained in:
@@ -17,10 +17,13 @@ class ServerAudioUser extends EventEmitter {
|
||||
super();
|
||||
|
||||
this.name = options.name;
|
||||
this.inputChannel = parseInt(options.inputChannel, 10);
|
||||
this.inputChannel = (options.inputChannel !== null && options.inputChannel !== undefined)
|
||||
? parseInt(options.inputChannel, 10)
|
||||
: null;
|
||||
this.outputChannel = (options.outputChannel !== null && options.outputChannel !== undefined)
|
||||
? parseInt(options.outputChannel, 10)
|
||||
: null;
|
||||
this.publish = options.publish !== false; // false = écoute seule
|
||||
this.groupId = options.groupId;
|
||||
this.frameSize = options.frameSize || 960;
|
||||
this.sampleRate = options.sampleRate || 48000;
|
||||
@@ -45,7 +48,8 @@ class ServerAudioUser extends EventEmitter {
|
||||
|
||||
_setupClientEvents() {
|
||||
this.client.on('connected', () => {
|
||||
console.log(`[ServerAudioUser:${this.name}] Connecté à room "${this.groupId}" (in:${this.inputChannel} → out:${this.outputChannel ?? 'aucune'})`);
|
||||
const mode = this.publish ? `in:${this.inputChannel} → out:${this.outputChannel ?? 'aucune'}` : `écoute → out:${this.outputChannel ?? 'aucune'}`;
|
||||
console.log(`[ServerAudioUser:${this.name}] Connecté à room "${this.groupId}" (${mode})`);
|
||||
this.emit('connected');
|
||||
});
|
||||
|
||||
@@ -78,7 +82,7 @@ class ServerAudioUser extends EventEmitter {
|
||||
* @param {Float32Array} float32Data - Données PCM normalisées [-1.0, 1.0]
|
||||
*/
|
||||
sendAudio(float32Data) {
|
||||
if (!this.client.isConnected) return;
|
||||
if (!this.publish || !this.client.isConnected) return;
|
||||
|
||||
const pcmBuffer = this._float32ToBuffer(float32Data);
|
||||
this.client.sendAudioData(pcmBuffer);
|
||||
|
||||
Reference in New Issue
Block a user