@pipecat-ai/daily-transport 1.6.9 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DailyCall, DailyCallOptions, DailyFactoryOptions, DailyMeetingSessionSummary, DailyMediaDeviceInfo } from "@daily-co/daily-js";
2
- import { PipecatClientOptions, RTVIEventCallbacks, RTVIMessage, Tracks, Transport, TransportState } from "@pipecat-ai/client-js";
2
+ import { MediaSupport, PipecatClientOptions, RTVIEventCallbacks, RTVIMessage, Tracks, Transport, TransportState } from "@pipecat-ai/client-js";
3
3
  export interface DailyConnectionEndpoint {
4
4
  endpoint: string;
5
5
  headers?: Headers;
@@ -42,6 +42,8 @@ export class DailyTransport extends Transport {
42
42
  get isCamEnabled(): boolean;
43
43
  enableScreenShare(enable: boolean): void;
44
44
  get isSharingScreen(): boolean;
45
+ /** Carries every kind of media; screen share where the browser can. */
46
+ get mediaSupport(): MediaSupport;
45
47
  tracks(): Tracks;
46
48
  preAuth(dailyCallOptions: DailyCallOptions): Promise<void>;
47
49
  initDevices(): Promise<void>;
@@ -1 +1 @@
1
- {"mappings":";;AAwCA;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,iDAAkD,SAAQ,mBAAmB;IAC3E,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAED;IACE,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;CACpD;AAED,kCAAkC,kBAAkB,GAClD,OAAO,CAAC;IACN,uBAAuB,EAAE,MAAM,IAAI,CAAC;IACpC,uBAAuB,EAAE,MAAM,IAAI,CAAC;CACrC,CAAC,CAAC;AAoDL,2BAA4B,SAAQ,SAAS;IAE3C,UAAkB,UAAU,EAAE,mBAAmB,CAAC;gBAgCtC,IAAI,GAAE,gCAAqC;IAkCvD,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IA2B9C,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI;IAoBxC,UAAU,CACf,OAAO,EAAE,oBAAoB,EAC7B,cAAc,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,GACxC,IAAI;IAgCP,IAAI,eAAe,IAAI,SAAS,CAE/B;IAED,IAAI,KAAK,IAAI,cAAc,CAE1B;IAED,OAAO,KAAK,KAAK,QAKhB;IAED,cAAc;IAIR,UAAU;IAKhB,SAAS,CAAC,KAAK,EAAE,MAAM;IAUvB,IAAI,WAAW,4CAEd;IAEK,UAAU;IAKhB,SAAS,CAAC,KAAK,EAAE,MAAM;IAUvB,IAAI,WAAW,4CAEd;IAEK,cAAc;IAKpB,aAAa,CAAC,SAAS,EAAE,MAAM;IAa/B,IAAI,eAAe,4CAElB;IAED,SAAS,CAAC,MAAM,EAAE,OAAO;IAazB,IAAI,YAAY,YAEf;IAED,SAAS,CAAC,MAAM,EAAE,OAAO;IAQzB,IAAI,YAAY,YAEf;IAEM,iBAAiB,CAAC,MAAM,EAAE,OAAO;IAQxC,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,MAAM;IAuCA,OAAO,CAAC,gBAAgB,EAAE,gBAAgB;IAK1C,WAAW;IAgCjB,yBAAyB,CACvB,aAAa,CAAC,EAAE,OAAO,GACtB,gBAAgB,GAAG,SAAS;IA+BzB,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB;IAiCzC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiGjC,WAAW;IAYV,WAAW,CAAC,OAAO,EAAE,WAAW;CAmRxC","sources":["transports/daily/src/src/transport.ts","transports/daily/src/src/index.ts","transports/daily/src/index.ts"],"sourcesContent":[null,null,"export * from \"./transport\";\n"],"names":[],"version":3,"file":"index.d.ts.map"}
1
+ {"mappings":";;AA4CA;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,iDAAkD,SAAQ,mBAAmB;IAC3E,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAED;IACE,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;CACpD;AAED,kCAAkC,kBAAkB,GAClD,OAAO,CAAC;IACN,uBAAuB,EAAE,MAAM,IAAI,CAAC;IACpC,uBAAuB,EAAE,MAAM,IAAI,CAAC;CACrC,CAAC,CAAC;AAoDL,2BAA4B,SAAQ,SAAS;IAE3C,UAAkB,UAAU,EAAE,mBAAmB,CAAC;gBAgCtC,IAAI,GAAE,gCAAqC;IAkCvD,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IA2B9C,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI;IAoBxC,UAAU,CACf,OAAO,EAAE,oBAAoB,EAC7B,cAAc,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,GACxC,IAAI;IAgCP,IAAI,eAAe,IAAI,SAAS,CAE/B;IAED,IAAI,KAAK,IAAI,cAAc,CAE1B;IAED,OAAO,KAAK,KAAK,QAKhB;IAED,cAAc;IAIR,UAAU;IAKhB,SAAS,CAAC,KAAK,EAAE,MAAM;IAUvB,IAAI,WAAW,4CAEd;IAEK,UAAU;IAKhB,SAAS,CAAC,KAAK,EAAE,MAAM;IAUvB,IAAI,WAAW,4CAEd;IAEK,cAAc;IAKpB,aAAa,CAAC,SAAS,EAAE,MAAM;IAa/B,IAAI,eAAe,4CAElB;IAED,SAAS,CAAC,MAAM,EAAE,OAAO;IAazB,IAAI,YAAY,YAEf;IAED,SAAS,CAAC,MAAM,EAAE,OAAO;IAQzB,IAAI,YAAY,YAEf;IAEM,iBAAiB,CAAC,MAAM,EAAE,OAAO;IAQxC,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,uEAAuE;IACvE,IAAI,YAAY,IAAI,YAAY,CAQ/B;IAED,MAAM;IAuCA,OAAO,CAAC,gBAAgB,EAAE,gBAAgB;IAK1C,WAAW;IAuCjB,yBAAyB,CACvB,aAAa,CAAC,EAAE,OAAO,GACtB,gBAAgB,GAAG,SAAS;IA+BzB,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB;IAwCzC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiGjC,WAAW;IAYV,WAAW,CAAC,OAAO,EAAE,WAAW;CAmRxC","sources":["transports/daily/src/src/transport.ts","transports/daily/src/src/index.ts","transports/daily/src/index.ts"],"sourcesContent":[null,null,"export * from \"./transport\";\n"],"names":[],"version":3,"file":"index.d.ts.map"}
package/dist/index.js CHANGED
@@ -34,6 +34,42 @@ $parcel$export($1c83796b12dd4e49$exports, "DailyTransport", () => $1c83796b12dd4
34
34
 
35
35
 
36
36
  /**
37
+ * Whether this browser can share a screen. Most mobile browsers, including
38
+ * iOS Safari, have no `getDisplayMedia`.
39
+ */ function $15398512372f76d1$export$7f8f33b9b54c8307() {
40
+ return typeof navigator?.mediaDevices?.getDisplayMedia === "function";
41
+ }
42
+
43
+
44
+ /*!
45
+ * wavtools is adapted from openai-realtime-console
46
+ * (https://github.com/openai/openai-realtime-console) and modified by Daily.
47
+ *
48
+ * @license MIT
49
+ *
50
+ * Copyright (c) 2024 OpenAI
51
+ *
52
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
53
+ * of this software and associated documentation files (the "Software"), to deal
54
+ * in the Software without restriction, including without limitation the rights
55
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
56
+ * copies of the Software, and to permit persons to whom the Software is
57
+ * furnished to do so, subject to the following conditions:
58
+ *
59
+ * The above copyright notice and this permission notice shall be included in all
60
+ * copies or substantial portions of the Software.
61
+ *
62
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
67
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
68
+ * SOFTWARE.
69
+ */ /*!
70
+ * Adapted from openai-realtime-console (https://github.com/openai/openai-realtime-console).
71
+ * Copyright (c) 2024 OpenAI. Modified by Daily. MIT License; see wavtools/index.js.
72
+ */ /**
37
73
  * Raw wav audio file contents
38
74
  * @typedef {Object} WavPackerAudioType
39
75
  * @property {Blob} blob
@@ -135,7 +171,13 @@ $parcel$export($1c83796b12dd4e49$exports, "DailyTransport", () => $1c83796b12dd4
135
171
  globalThis.WavPacker = $45766326c6faa3c4$export$13afda237b1c9846;
136
172
 
137
173
 
138
- /**
174
+ /*!
175
+ * Adapted from openai-realtime-console (https://github.com/openai/openai-realtime-console).
176
+ * Copyright (c) 2024 OpenAI. Modified by Daily. MIT License; see wavtools/index.js.
177
+ */ /*!
178
+ * Adapted from openai-realtime-console (https://github.com/openai/openai-realtime-console).
179
+ * Copyright (c) 2024 OpenAI. Modified by Daily. MIT License; see wavtools/index.js.
180
+ */ /**
139
181
  * Constants for help with visualization
140
182
  * Helps map frequency ranges from Fast Fourier Transform
141
183
  * to human-interpretable ranges, notably music ranges and
@@ -333,7 +375,13 @@ class $3f7a723e434a4b86$export$2c3136da0bf130f9 {
333
375
  globalThis.AudioAnalysis = $3f7a723e434a4b86$export$2c3136da0bf130f9;
334
376
 
335
377
 
336
- const $ff75ae50979bb4fc$export$50b76700e2b15e9 = `
378
+ /*!
379
+ * Adapted from openai-realtime-console (https://github.com/openai/openai-realtime-console).
380
+ * Copyright (c) 2024 OpenAI. Modified by Daily. MIT License; see wavtools/index.js.
381
+ */ /*!
382
+ * Adapted from openai-realtime-console (https://github.com/openai/openai-realtime-console).
383
+ * Copyright (c) 2024 OpenAI. Modified by Daily. MIT License; see wavtools/index.js.
384
+ */ const $ff75ae50979bb4fc$export$50b76700e2b15e9 = `
337
385
  class StreamProcessor extends AudioWorkletProcessor {
338
386
  constructor() {
339
387
  super();
@@ -570,7 +618,13 @@ class $347522367945ce82$export$9698d62c78b8f366 {
570
618
  globalThis.WavStreamPlayer = $347522367945ce82$export$9698d62c78b8f366;
571
619
 
572
620
 
573
- const $5a5c5ac16a3be24c$var$AudioProcessorWorklet = `
621
+ /*!
622
+ * Adapted from openai-realtime-console (https://github.com/openai/openai-realtime-console).
623
+ * Copyright (c) 2024 OpenAI. Modified by Daily. MIT License; see wavtools/index.js.
624
+ */ /*!
625
+ * Adapted from openai-realtime-console (https://github.com/openai/openai-realtime-console).
626
+ * Copyright (c) 2024 OpenAI. Modified by Daily. MIT License; see wavtools/index.js.
627
+ */ const $5a5c5ac16a3be24c$var$AudioProcessorWorklet = `
574
628
  class AudioProcessor extends AudioWorkletProcessor {
575
629
 
576
630
  constructor() {
@@ -1232,7 +1286,10 @@ class $35ad6181fc724add$export$439b217ca659a877 {
1232
1286
  globalThis.WavRecorder = $35ad6181fc724add$export$439b217ca659a877;
1233
1287
 
1234
1288
 
1235
-
1289
+ /*!
1290
+ * Adapted from openai-realtime-console (https://github.com/openai/openai-realtime-console).
1291
+ * Copyright (c) 2024 OpenAI. Modified by Daily. MIT License; see wavtools/index.js.
1292
+ */
1236
1293
 
1237
1294
 
1238
1295
  /**
@@ -1544,6 +1601,17 @@ class $48faeb169c82673e$export$4a0c46dbbe2ddb67 {
1544
1601
  get supportsScreenShare() {
1545
1602
  return this._supportsScreenShare;
1546
1603
  }
1604
+ /**
1605
+ * The kinds of media this media manager can capture, for the transport's
1606
+ * `mediaSupport`. `false` rules a kind out, and a missing key leaves it unknown.
1607
+ * By default only screen share can be ruled out: `screenShare` is `false` when
1608
+ * `supportsScreenShare` is, because this media manager or the browser can't
1609
+ * share the screen. Media managers that know more override this.
1610
+ */ get mediaSupport() {
1611
+ return this._supportsScreenShare ? {} : {
1612
+ screenShare: false
1613
+ };
1614
+ }
1547
1615
  }
1548
1616
  class $48faeb169c82673e$export$45c5b9bfba2f6304 extends $48faeb169c82673e$export$4a0c46dbbe2ddb67 {
1549
1617
  constructor(recorderChunkSize, recorderSampleRate = 24000){
@@ -1558,6 +1626,13 @@ class $48faeb169c82673e$export$45c5b9bfba2f6304 extends $48faeb169c82673e$export
1558
1626
  sampleRate: 24000
1559
1627
  });
1560
1628
  }
1629
+ /** Captures the microphone only. */ get mediaSupport() {
1630
+ return {
1631
+ mic: true,
1632
+ cam: false,
1633
+ screenShare: false
1634
+ };
1635
+ }
1561
1636
  async initialize() {
1562
1637
  try {
1563
1638
  await this._wavRecorder.begin();
@@ -1584,7 +1659,7 @@ class $48faeb169c82673e$export$45c5b9bfba2f6304 extends $48faeb169c82673e$export
1584
1659
  await this._wavStreamPlayer.interrupt();
1585
1660
  this._initialized = false;
1586
1661
  }
1587
- async userStartedSpeaking() {
1662
+ async interruptBotAudio() {
1588
1663
  return this._wavStreamPlayer.interrupt();
1589
1664
  }
1590
1665
  bufferBotAudio(data, id) {
@@ -1704,6 +1779,7 @@ const $48faeb169c82673e$var$localParticipant = ()=>{
1704
1779
 
1705
1780
 
1706
1781
 
1782
+
1707
1783
  class $00a190ef6aa79f0d$export$c95c65abc5f47125 extends (0, $48faeb169c82673e$export$4a0c46dbbe2ddb67) {
1708
1784
  constructor(enablePlayer = true, enableRecording = true, onTrackStartedCallback, onTrackStoppedCallback, recorderChunkSize, recorderSampleRate = 24000, playerSampleRate = 24000){
1709
1785
  super();
@@ -1719,7 +1795,7 @@ class $00a190ef6aa79f0d$export$c95c65abc5f47125 extends (0, $48faeb169c82673e$ex
1719
1795
  this.onTrackStartedCallback = onTrackStartedCallback;
1720
1796
  this.onTrackStoppedCallback = onTrackStoppedCallback;
1721
1797
  this._recorderChunkSize = recorderChunkSize;
1722
- this._supportsScreenShare = true;
1798
+ this._supportsScreenShare = (0, $15398512372f76d1$export$7f8f33b9b54c8307)();
1723
1799
  this._daily = (0, ($parcel$interopDefault($1clrS$dailycodailyjs))).getCallInstance() ?? (0, ($parcel$interopDefault($1clrS$dailycodailyjs))).createCallObject();
1724
1800
  if (enableRecording) this._mediaStreamRecorder = new (0, $ab812aec7679ec67$export$2934cf2d25c67a48)({
1725
1801
  sampleRate: recorderSampleRate
@@ -1802,7 +1878,7 @@ class $00a190ef6aa79f0d$export$c95c65abc5f47125 extends (0, $48faeb169c82673e$ex
1802
1878
  this._initialized = false;
1803
1879
  this._connected = false;
1804
1880
  }
1805
- async userStartedSpeaking() {
1881
+ async interruptBotAudio() {
1806
1882
  return this._wavStreamPlayer?.interrupt();
1807
1883
  }
1808
1884
  bufferBotAudio(data, id) {
@@ -1910,6 +1986,13 @@ class $00a190ef6aa79f0d$export$c95c65abc5f47125 extends (0, $48faeb169c82673e$ex
1910
1986
  get isMicEnabled() {
1911
1987
  return this._micEnabled;
1912
1988
  }
1989
+ /** Captures the microphone, the camera and, where the browser can, the screen. */ get mediaSupport() {
1990
+ return {
1991
+ mic: true,
1992
+ cam: true,
1993
+ screenShare: this._supportsScreenShare
1994
+ };
1995
+ }
1913
1996
  get isSharingScreen() {
1914
1997
  return this._daily.localScreenAudio() || this._daily.localScreenVideo();
1915
1998
  }
@@ -2468,7 +2551,7 @@ class $7f41aaa208a19660$export$4f3d0ffd941ebefb extends (0, $1clrS$events.EventE
2468
2551
 
2469
2552
 
2470
2553
  var $48b67f1ef231aa26$exports = {};
2471
- $48b67f1ef231aa26$exports = JSON.parse("{\"name\":\"@pipecat-ai/daily-transport\",\"version\":\"1.6.9\",\"license\":\"BSD-2-Clause\",\"main\":\"dist/index.js\",\"module\":\"dist/index.module.js\",\"types\":\"dist/index.d.ts\",\"source\":\"src/index.ts\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/pipecat-ai/pipecat-client-web-transports.git\"},\"exports\":{\".\":{\"types\":\"./dist/index.d.ts\",\"import\":\"./dist/index.module.js\",\"require\":\"./dist/index.js\"}},\"files\":[\"dist\",\"package.json\",\"README.md\"],\"targets\":{\"main\":{\"includeNodeModules\":[\"@pipecat-ai/transport-lib\"]},\"module\":{\"includeNodeModules\":[\"@pipecat-ai/transport-lib\"]}},\"scripts\":{\"build\":\"parcel build --no-cache\",\"dev\":\"parcel watch\",\"lint\":\"eslint . --ext ts --report-unused-disable-directives --max-warnings 0\"},\"devDependencies\":{\"@pipecat-ai/client-js\":\"^1.13.0\",\"@pipecat-ai/transport-lib\":\"^0.1.0\",\"eslint\":\"9.39.1\",\"eslint-config-prettier\":\"^9.1.0\",\"eslint-plugin-simple-import-sort\":\"^12.1.1\"},\"peerDependencies\":{\"@pipecat-ai/client-js\":\"~1.13.0\"},\"dependencies\":{\"@daily-co/daily-js\":\"^0.90.0\"},\"description\":\"Pipecat Daily Transport Package\",\"author\":\"Daily.co\",\"bugs\":{\"url\":\"https://github.com/pipecat-ai/pipecat-client-web-transports/issues\"},\"homepage\":\"https://github.com/pipecat-ai/pipecat-client-web-transports/blob/main/transports/daily-webrtc/README.md\"}");
2554
+ $48b67f1ef231aa26$exports = JSON.parse("{\"name\":\"@pipecat-ai/daily-transport\",\"version\":\"1.7.1\",\"license\":\"BSD-2-Clause\",\"main\":\"dist/index.js\",\"module\":\"dist/index.module.js\",\"types\":\"dist/index.d.ts\",\"source\":\"src/index.ts\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/pipecat-ai/pipecat-client-web-transports.git\"},\"exports\":{\".\":{\"types\":\"./dist/index.d.ts\",\"import\":\"./dist/index.module.js\",\"require\":\"./dist/index.js\"}},\"files\":[\"dist\",\"package.json\",\"README.md\"],\"targets\":{\"main\":{\"includeNodeModules\":[\"@pipecat-ai/transport-lib\"]},\"module\":{\"includeNodeModules\":[\"@pipecat-ai/transport-lib\"]}},\"scripts\":{\"build\":\"parcel build --no-cache\",\"dev\":\"parcel watch\",\"lint\":\"eslint . --ext ts --report-unused-disable-directives --max-warnings 0\"},\"devDependencies\":{\"@pipecat-ai/client-js\":\"^1.15.0\",\"@pipecat-ai/transport-lib\":\"^0.2.0\",\"eslint\":\"9.39.1\",\"eslint-config-prettier\":\"^9.1.0\",\"eslint-plugin-simple-import-sort\":\"^12.1.1\"},\"peerDependencies\":{\"@pipecat-ai/client-js\":\"~1.15.0\"},\"dependencies\":{\"@daily-co/daily-js\":\"^0.94.0\"},\"description\":\"Pipecat Daily Transport Package\",\"author\":\"Daily.co\",\"bugs\":{\"url\":\"https://github.com/pipecat-ai/pipecat-client-web-transports/issues\"},\"homepage\":\"https://github.com/pipecat-ai/pipecat-client-web-transports/blob/main/transports/daily-webrtc/README.md\"}");
2472
2555
 
2473
2556
 
2474
2557
  var $1c83796b12dd4e49$export$ef180de88fd317cc;
@@ -2698,6 +2781,15 @@ class $1c83796b12dd4e49$export$b1ca982aa1e488c1 extends (0, $1clrS$pipecataiclie
2698
2781
  get isSharingScreen() {
2699
2782
  return this._daily.localScreenAudio() || this._daily.localScreenVideo();
2700
2783
  }
2784
+ /** Carries every kind of media; screen share where the browser can. */ get mediaSupport() {
2785
+ return {
2786
+ mic: true,
2787
+ cam: true,
2788
+ screenShare: (0, $15398512372f76d1$export$7f8f33b9b54c8307)(),
2789
+ botAudio: true,
2790
+ botVideo: true
2791
+ };
2792
+ }
2701
2793
  tracks() {
2702
2794
  const participants = this._daily.participants() ?? {};
2703
2795
  const bot = participants?.[this._botId];
@@ -2749,11 +2841,17 @@ class $1c83796b12dd4e49$export$b1ca982aa1e488c1 extends (0, $1clrS$pipecataiclie
2749
2841
  this._callbacks.onCamUpdated?.(infos.camera);
2750
2842
  this._callbacks.onMicUpdated?.(infos.mic);
2751
2843
  this._callbacks.onSpeakerUpdated?.(infos.speaker);
2752
- // Instantiate audio observers
2753
- if (!this._daily.isLocalAudioLevelObserverRunning()) await this._daily.startLocalAudioLevelObserver(100);
2754
- if (!this._daily.isRemoteParticipantsAudioLevelObserverRunning()) await this._daily.startRemoteParticipantsAudioLevelObserver(100);
2844
+ await this.startAudioLevelObservers();
2755
2845
  this.state = "initialized";
2756
2846
  }
2847
+ async startAudioLevelObservers() {
2848
+ try {
2849
+ if (!this._daily.isLocalAudioLevelObserverRunning()) await this._daily.startLocalAudioLevelObserver(100);
2850
+ if (!this._daily.isRemoteParticipantsAudioLevelObserverRunning()) await this._daily.startRemoteParticipantsAudioLevelObserver(100);
2851
+ } catch (e) {
2852
+ (0, $1clrS$pipecataiclientjs.logger).warn("[Daily Transport] Failed to start audio level observers", e);
2853
+ }
2854
+ }
2757
2855
  _validateConnectionParams(connectParams) {
2758
2856
  if (connectParams === undefined || connectParams === null) return undefined;
2759
2857
  if (typeof connectParams !== "object") throw new (0, $1clrS$pipecataiclientjs.RTVIError)("Invalid connection parameters");
@@ -2788,6 +2886,12 @@ class $1c83796b12dd4e49$export$b1ca982aa1e488c1 extends (0, $1clrS$pipecataiclie
2788
2886
  throw new (0, $1clrS$pipecataiclientjs.TransportStartError)();
2789
2887
  }
2790
2888
  if (this._abortController?.signal.aborted) return;
2889
+ // initDevices() is not guaranteed to have run before we get here:
2890
+ // PipecatClient skips it when both mic and cam start disabled, and on a
2891
+ // reconnect once devices are already initialized. _disconnect() stops
2892
+ // the observers, so make sure they are running for this session or
2893
+ // onLocalAudioLevel / onRemoteAudioLevel never fire.
2894
+ await this.startAudioLevelObservers();
2791
2895
  const r = await this._daily.room();
2792
2896
  this._maxMessageSize = r?.domainConfig?.max_app_message_size || 10485760;
2793
2897
  this.state = "connected";