Merge pull request #2931 from ivaaan/hume-bugfix

Hume: use Octave v1 if description provided
This commit is contained in:
Mark Backman
2025-10-29 13:40:21 -04:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -45,6 +45,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed an issue in `ServiceSwitcher` where the `STTService`s would result in - Fixed an issue in `ServiceSwitcher` where the `STTService`s would result in
all STT services producing `TranscriptionFrame`s. all STT services producing `TranscriptionFrame`s.
- Fixed an issue in `HumeTTSService` that was only using Octave 2, which does not support the `description` field. Now, if a description is provided, it switches to Octave 1.
## [0.0.91] - 2025-10-21 ## [0.0.91] - 2025-10-21
### Added ### Added

View File

@@ -184,11 +184,15 @@ class HumeTTSService(TTSService):
# Hume emits mono PCM at 48 kHz; downstream can resample if needed. # Hume emits mono PCM at 48 kHz; downstream can resample if needed.
# We buffer audio bytes before sending to prevent glitches. # We buffer audio bytes before sending to prevent glitches.
self._audio_bytes = b"" self._audio_bytes = b""
# Use version "2" by default if no description is provided
# Version "1" is needed when description is used
version = "1" if self._params.description is not None else "2"
async for chunk in self._client.tts.synthesize_json_streaming( async for chunk in self._client.tts.synthesize_json_streaming(
utterances=[utterance], utterances=[utterance],
format=pcm_fmt, format=pcm_fmt,
instant_mode=True, instant_mode=True,
version="2", version=version,
): ):
audio_b64 = getattr(chunk, "audio", None) audio_b64 = getattr(chunk, "audio", None)
if not audio_b64: if not audio_b64: