Merge branch 'feat/enhance-multi-modal-support' into deploy/dev

This commit is contained in:
-LAN- 2024-10-17 16:40:49 +08:00
commit dee5d0911e

View File

@ -27,7 +27,7 @@ class PodcastAudioGeneratorTool(BuiltinTool):
) -> tuple[int, Union[AudioSegment, str], Optional[AudioSegment]]: ) -> tuple[int, Union[AudioSegment, str], Optional[AudioSegment]]:
try: try:
response = client.audio.speech.create(model="tts-1", voice=voice, input=line.strip()) response = client.audio.speech.create(model="tts-1", voice=voice, input=line.strip())
audio = AudioSegment.from_file(io.BytesIO(response.content)) audio = AudioSegment.from_file(io.BytesIO(response.content), format="wav")
silence_duration = random.uniform(0.1, 1.5) silence_duration = random.uniform(0.1, 1.5)
silence = PodcastAudioGeneratorTool._generate_silence(silence_duration) silence = PodcastAudioGeneratorTool._generate_silence(silence_duration)
return index, audio, silence return index, audio, silence