fix(podcast_audio_generator): remove explicit format specification for audio file loading

This commit is contained in:
-LAN- 2024-10-17 16:04:49 +08:00
parent 760b18fe26
commit 9156cfd384

View File

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