diff --git a/client/dev-dist/sw.js b/client/dev-dist/sw.js index ec59118..905af22 100644 --- a/client/dev-dist/sw.js +++ b/client/dev-dist/sw.js @@ -81,7 +81,7 @@ define(['./workbox-290dd570'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.guj84039cv8" + "revision": "0.n59u4ot43hg" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/client/dev-dist/sw.js.map b/client/dev-dist/sw.js.map index 80e41e4..a6735c7 100644 --- a/client/dev-dist/sw.js.map +++ b/client/dev-dist/sw.js.map @@ -1 +1 @@ -{"version":3,"file":"sw.js","sources":["../../../../../../private/var/folders/lc/87d3wzj544l4skb096m6003m0000gn/T/cb1d8b848490721ac3a2686857ee4702/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-routing/registerRoute.mjs';\nimport {ExpirationPlugin as workbox_expiration_ExpirationPlugin} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-expiration/ExpirationPlugin.mjs';\nimport {NetworkFirst as workbox_strategies_NetworkFirst} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-strategies/NetworkFirst.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\nself.skipWaiting();\nworkbox_core_clientsClaim();\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"registerSW.js\",\n \"revision\": \"3ca0b8505b4bec776b69afdba2768812\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"0.guj84039cv8\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();workbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"index.html\"), {\n allowlist: [/^\\/$/], }));\nworkbox_routing_registerRoute(/^https:\\/\\/.*\\.livekit\\.cloud\\/.*/i, new workbox_strategies_NetworkFirst({ \"cacheName\":\"livekit-cache\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 10, maxAgeSeconds: 86400 })] }), 'GET');\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","workbox_precaching_cleanupOutdatedCaches","workbox_routing_registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","allowlist","workbox_strategies_NetworkFirst","plugins","workbox_expiration_ExpirationPlugin","maxEntries","maxAgeSeconds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBAA,CAAAA,CAAAA,CAAAA,CAAI,CAACC,WAAW,CAAA,CAAE;AAClBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CA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AAA,CAAE;AAAEC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,aAAa,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA;AAAM,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC;EAAE,CAAC,CAAC,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC;;"} \ No newline at end of file +{"version":3,"file":"sw.js","sources":["../../../../../../private/var/folders/lc/87d3wzj544l4skb096m6003m0000gn/T/8e656f8f6dcfe6273dcd903207c3c109/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-routing/registerRoute.mjs';\nimport {ExpirationPlugin as workbox_expiration_ExpirationPlugin} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-expiration/ExpirationPlugin.mjs';\nimport {NetworkFirst as workbox_strategies_NetworkFirst} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-strategies/NetworkFirst.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/Users/benoit/Documents/code/PTT Live/client/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\nself.skipWaiting();\nworkbox_core_clientsClaim();\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"registerSW.js\",\n \"revision\": \"3ca0b8505b4bec776b69afdba2768812\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"0.n59u4ot43hg\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();workbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"index.html\"), {\n allowlist: [/^\\/$/], }));\nworkbox_routing_registerRoute(/^https:\\/\\/.*\\.livekit\\.cloud\\/.*/i, new workbox_strategies_NetworkFirst({ \"cacheName\":\"livekit-cache\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 10, maxAgeSeconds: 86400 })] }), 'GET');\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","workbox_precaching_cleanupOutdatedCaches","workbox_routing_registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","allowlist","workbox_strategies_NetworkFirst","plugins","workbox_expiration_ExpirationPlugin","maxEntries","maxAgeSeconds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBAA,CAAAA,CAAAA,CAAAA,CAAI,CAACC,WAAW,CAAA,CAAE;AAClBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAyB,CAAA,CAAE;AAC3B,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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AAC;;"} \ No newline at end of file diff --git a/server/bridge/LiveKitClient.js b/server/bridge/LiveKitClient.js index 3f39823..9926841 100644 --- a/server/bridge/LiveKitClient.js +++ b/server/bridge/LiveKitClient.js @@ -1,23 +1,16 @@ /** * LiveKitClient.js - * Client LiveKit pour le bridge audio serveur + * Client LiveKit pour le bridge audio serveur (Node.js) * - * Gère : + * Utilise @livekit/rtc-node pour : * - Connexion à la room en tant que participant "bridge" - * - Publication de track audio (Opus depuis carte son) + * - Publication de tracks audio (PCM depuis carte son) * - Souscription aux tracks des autres participants (clients PWA) + * - Gestion audio bas niveau (AudioSource/AudioStream) * - Reconnexion automatique */ -import { - Room, - RoomEvent, - RemoteTrack, - RemoteParticipant, - LocalAudioTrack, - TrackPublishOptions, - AudioPresets -} from 'livekit-client'; +import { Room, RoomEvent, AudioSource, AudioFrame } from '@livekit/rtc-node'; import { EventEmitter } from 'events'; export class LiveKitClient extends EventEmitter { @@ -30,11 +23,13 @@ export class LiveKitClient extends EventEmitter { participantName: options.participantName || 'AudioBridge', token: options.token || null, autoSubscribe: options.autoSubscribe !== false, - audioBitrate: options.audioBitrate || 96000, // 96kbps par défaut + sampleRate: options.sampleRate || 48000, + channels: options.channels || 1, // Mono par défaut pour PTT ...options }; this.room = null; + this.audioSource = null; this.localAudioTrack = null; this.isConnected = false; this.reconnecting = false; @@ -58,13 +53,8 @@ export class LiveKitClient extends EventEmitter { } try { - this.room = new Room({ - adaptiveStream: true, - dynacast: true, - reconnectionPolicy: { - nextRetryDelayInMs: (retryCount) => Math.min(1000 * Math.pow(2, retryCount), 10000) - } - }); + // Création room + this.room = new Room(); // Configuration des event listeners this._setupEventListeners(); @@ -79,6 +69,10 @@ export class LiveKitClient extends EventEmitter { roomName: this.options.roomName, participantName: this.options.participantName }); + + // Création de l'AudioSource pour pouvoir publier de l'audio + await this._createAudioSource(); + } catch (error) { console.error('Erreur connexion LiveKit:', error); this.emit('error', error); @@ -86,6 +80,36 @@ export class LiveKitClient extends EventEmitter { } } + /** + * Crée une AudioSource pour la publication audio + * @private + */ + async _createAudioSource() { + try { + this.audioSource = new AudioSource( + this.options.sampleRate, + this.options.channels + ); + + // Publication du track audio + const options = { + source: 'microphone' // Simule un microphone pour les clients + }; + + this.localAudioTrack = await this.room.localParticipant.publishTrack( + this.audioSource, + options + ); + + console.log('✓ AudioSource créée et track publié'); + this.emit('trackPublished', this.localAudioTrack); + + } catch (error) { + console.error('Erreur création AudioSource:', error); + throw error; + } + } + /** * Configuration des event listeners de la room * @private @@ -93,28 +117,17 @@ export class LiveKitClient extends EventEmitter { _setupEventListeners() { if (!this.room) return; - // Connexion/déconnexion + // Connexion this.room.on(RoomEvent.Connected, () => { console.log('✓ Room connectée'); this.isConnected = true; }); - this.room.on(RoomEvent.Disconnected, (reason) => { - console.log('⚠ Room déconnectée:', reason); + // Déconnexion + this.room.on(RoomEvent.Disconnected, () => { + console.log('⚠ Room déconnectée'); this.isConnected = false; - this.emit('disconnected', { reason }); - }); - - this.room.on(RoomEvent.Reconnecting, () => { - console.log('🔄 Reconnexion en cours...'); - this.reconnecting = true; - this.emit('reconnecting'); - }); - - this.room.on(RoomEvent.Reconnected, () => { - console.log('✓ Reconnecté'); - this.reconnecting = false; - this.emit('reconnected'); + this.emit('disconnected'); }); // Participants @@ -133,11 +146,23 @@ export class LiveKitClient extends EventEmitter { this.room.on(RoomEvent.TrackSubscribed, (track, publication, participant) => { if (track.kind === 'audio') { console.log(`🎵 Track audio souscrit de ${participant.identity}`); + + // Création d'un AudioStream pour recevoir les données PCM + const stream = new track.AudioStream( + this.options.sampleRate, + this.options.channels + ); + this.remoteParticipants.set(participant.sid, { participant, track, - publication + publication, + stream }); + + // Lecture des frames audio + this._startAudioReceive(participant.sid, stream); + this.emit('audioTrackSubscribed', { track, participant }); } }); @@ -149,77 +174,72 @@ export class LiveKitClient extends EventEmitter { this.emit('audioTrackUnsubscribed', { track, participant }); } }); - - // Données audio - this.room.on(RoomEvent.AudioPlaybackStatusChanged, () => { - this.emit('audioPlaybackChanged'); - }); - - // Erreurs - this.room.on(RoomEvent.ConnectionQualityChanged, (quality, participant) => { - this.emit('qualityChanged', { quality, participant }); - }); } /** - * Publie un track audio local depuis le bridge - * Note: Pour un bridge serveur, on utilise plutôt publishData pour envoyer Opus directement - * @param {MediaStreamTrack} mediaStreamTrack - Track audio du microphone - * @returns {Promise} + * Démarre la réception audio d'un participant + * @private */ - async publishAudioTrack(mediaStreamTrack) { - if (!this.isConnected) { - throw new Error('Pas connecté à LiveKit'); + async _startAudioReceive(participantSid, stream) { + try { + // Lecture continue des frames audio + for await (const frame of stream) { + // frame est un AudioFrame avec : + // - data: Buffer PCM int16 + // - sampleRate: number + // - numChannels: number + // - samplesPerChannel: number + + const participant = this.remoteParticipants.get(participantSid); + if (!participant) break; + + // Émettre les données audio vers AudioBridge + this.emit('audioData', { + participantSid, + participantName: participant.participant.identity, + pcmData: frame.data, + sampleRate: frame.sampleRate, + channels: frame.numChannels, + samplesPerChannel: frame.samplesPerChannel + }); + } + } catch (error) { + console.error(`Erreur réception audio ${participantSid}:`, error); + } + } + + /** + * Envoie des données audio PCM vers les clients + * @param {Buffer} pcmData - Données PCM int16 (mono ou multi-canal) + */ + async sendAudioData(pcmData) { + if (!this.audioSource) { + console.warn('AudioSource non initialisée'); + return; } try { - // Options de publication - const options = { - name: 'bridge-audio', - source: 'microphone', - audioBitrate: this.options.audioBitrate - }; + // Création d'un AudioFrame + const samplesPerChannel = pcmData.length / 2 / this.options.channels; - this.localAudioTrack = await this.room.localParticipant.publishTrack( - mediaStreamTrack, - options + const frame = new AudioFrame( + pcmData, + this.options.sampleRate, + this.options.channels, + samplesPerChannel ); - console.log('✓ Track audio local publié'); - this.emit('trackPublished', this.localAudioTrack); + // Envoi via AudioSource + await this.audioSource.captureFrame(frame); + } catch (error) { - console.error('Erreur publication track:', error); - this.emit('error', error); - throw error; + console.error('Erreur envoi audio:', error); } } - /** - * Unpublish le track audio local - */ - async unpublishAudioTrack() { - if (this.localAudioTrack) { - await this.room.localParticipant.unpublishTrack(this.localAudioTrack); - this.localAudioTrack = null; - console.log('✓ Track audio local dépublié'); - } - } - - /** - * Envoie des données audio Opus directement (pour bridge serveur) - * Alternative à publishAudioTrack pour contrôle bas niveau - * @param {Buffer} opusData - Données Opus encodées - */ - sendAudioData(opusData) { - // Note: LiveKit ne supporte pas directement l'envoi de données Opus brutes - // Cette méthode serait implémentée avec un track custom ou DataChannel - // Pour l'instant, on utilise publishAudioTrack avec un MediaStreamTrack - console.warn('sendAudioData: Non implémenté, utiliser publishAudioTrack'); - } - /** * Récupère tous les tracks audio distants actifs - * @returns {Array} Liste des tracks avec métadonnées + * @returns {Array} */ getRemoteAudioTracks() { return Array.from(this.remoteParticipants.values()).map(({ participant, track, publication }) => ({ @@ -234,7 +254,7 @@ export class LiveKitClient extends EventEmitter { /** * Récupère un participant distant par son SID - * @param {string} sid - SID du participant + * @param {string} sid * @returns {Object|null} */ getRemoteParticipant(sid) { @@ -261,15 +281,14 @@ export class LiveKitClient extends EventEmitter { localParticipant: { sid: localParticipant?.sid, identity: localParticipant?.identity, - tracksPublished: localParticipant?.trackPublications.size || 0 + tracksPublished: localParticipant?.trackPublications?.size || 0 }, remoteParticipants: { count: participants.size, list: Array.from(participants.values()).map(p => ({ sid: p.sid, identity: p.identity, - audioTracks: Array.from(p.audioTrackPublications.values()).length, - connectionQuality: p.connectionQuality + audioTracks: Array.from(p.audioTrackPublications?.values() || []).length })) } }; @@ -280,13 +299,20 @@ export class LiveKitClient extends EventEmitter { */ async disconnect() { if (this.room) { - await this.unpublishAudioTrack(); - this.room.disconnect(); + // Unpublish track + if (this.localAudioTrack) { + await this.room.localParticipant.unpublishTrack(this.localAudioTrack.sid); + this.localAudioTrack = null; + } + + // Déconnexion + await this.room.disconnect(); this.room = null; + this.audioSource = null; this.isConnected = false; this.remoteParticipants.clear(); console.log('✓ Déconnecté de LiveKit'); - this.emit('disconnected', { reason: 'manual' }); + this.emit('disconnected'); } } diff --git a/server/package.json b/server/package.json index d366e03..4d59aae 100644 --- a/server/package.json +++ b/server/package.json @@ -19,9 +19,9 @@ "author": "", "license": "MIT", "dependencies": { + "@livekit/rtc-node": "^0.13.28", "dotenv": "^17.4.2", "express": "^4.19.2", - "livekit-client": "^2.19.0", "livekit-server-sdk": "^2.6.0", "opusscript": "^0.1.1", "ws": "^8.17.0",