diff --git a/CHANGELOG.md b/CHANGELOG.md index 920fff5be..a612c66cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -145,6 +145,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- `DailyTransport` triggers `on_error` event if transcription can't be started + or stopped. + - `DailyTransport` updates: `start_dialout()` now returns two values: `session_id` and `error`. `start_recording()` now returns two values: `stream_id` and `error`. diff --git a/src/pipecat/transports/daily/transport.py b/src/pipecat/transports/daily/transport.py index e7e3ab8ef..18c36ee56 100644 --- a/src/pipecat/transports/daily/transport.py +++ b/src/pipecat/transports/daily/transport.py @@ -2479,7 +2479,11 @@ class DailyTransport(BaseTransport): async def _on_joined(self, data): """Handle room joined events.""" if self._params.transcription_enabled: - await self.start_transcription(self._params.transcription_settings) + # We report an error because we are starting transcription + # internally and if it fails we need to know. + error = await self.start_transcription(self._params.transcription_settings) + if error: + await self._on_error(f"Unable to start transcription: {error}") await self._call_event_handler("on_joined", data) async def _on_left(self): @@ -2489,7 +2493,11 @@ class DailyTransport(BaseTransport): async def _on_before_leave(self): """Handle before leave room events.""" if self._params.transcription_enabled: - await self.stop_transcription() + # We report an error because we are stopping transcription + # internally and if it fails we need to know. + error = await self.stop_transcription() + if error: + await self._on_error(f"Unable to stop transcription: {error}") await self._call_event_handler("on_before_leave") async def _on_error(self, error):