Yield TTSAudioRawFrame directly instead of calling private method
This commit is contained in:
@@ -338,11 +338,14 @@ class CambTTSService(TTSService):
|
|||||||
await self.start_tts_usage_metrics(text)
|
await self.start_tts_usage_metrics(text)
|
||||||
yield TTSStartedFrame()
|
yield TTSStartedFrame()
|
||||||
|
|
||||||
async for frame in self._stream_audio_frames_from_iterator(
|
async for chunk in response.content.iter_chunked(self.chunk_size):
|
||||||
response.content.iter_chunked(self.chunk_size), strip_wav_header=False
|
if chunk:
|
||||||
):
|
await self.stop_ttfb_metrics()
|
||||||
await self.stop_ttfb_metrics()
|
yield TTSAudioRawFrame(
|
||||||
yield frame
|
audio=chunk,
|
||||||
|
sample_rate=self.sample_rate,
|
||||||
|
num_channels=1,
|
||||||
|
)
|
||||||
|
|
||||||
except aiohttp.ClientError as e:
|
except aiohttp.ClientError as e:
|
||||||
error_msg = f"Network error communicating with Camb.ai: {e}"
|
error_msg = f"Network error communicating with Camb.ai: {e}"
|
||||||
|
|||||||
Reference in New Issue
Block a user