Play delayed messages from ElevenLabsTTSService if they still belong to the current context.
This commit is contained in:
@@ -24,6 +24,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
- Play delayed messages from `ElevenLabsTTSService` if they still belong to the
|
||||||
|
current context.
|
||||||
|
|
||||||
- Dependency compatibility improvements: Relaxed version constraints for core
|
- Dependency compatibility improvements: Relaxed version constraints for core
|
||||||
dependencies to support broader version ranges while maintaining stability:
|
dependencies to support broader version ranges while maintaining stability:
|
||||||
|
|
||||||
|
|||||||
@@ -548,8 +548,12 @@ class ElevenLabsTTSService(AudioContextWordTTSService):
|
|||||||
# Check if this message belongs to the current context.
|
# Check if this message belongs to the current context.
|
||||||
# This should never happen, so warn about it.
|
# This should never happen, so warn about it.
|
||||||
if not self.audio_context_available(received_ctx_id):
|
if not self.audio_context_available(received_ctx_id):
|
||||||
logger.warning(f"Ignoring message from unavailable context: {received_ctx_id}")
|
if self._context_id == received_ctx_id:
|
||||||
continue
|
logger.debug(f"Received a delayed message, recreating the context: {self._context_id}")
|
||||||
|
await self.create_audio_context(self._context_id)
|
||||||
|
else:
|
||||||
|
logger.warning(f"Ignoring message from unavailable context: {received_ctx_id}")
|
||||||
|
continue
|
||||||
|
|
||||||
if msg.get("audio"):
|
if msg.get("audio"):
|
||||||
await self.stop_ttfb_metrics()
|
await self.stop_ttfb_metrics()
|
||||||
|
|||||||
Reference in New Issue
Block a user