diff --git a/aider/voice.py b/aider/voice.py index accff611e..c9af7ae99 100644 --- a/aider/voice.py +++ b/aider/voice.py @@ -154,7 +154,7 @@ class Voice: try: new_filename = tempfile.mktemp(suffix=f".{use_audio_format}") audio = AudioSegment.from_wav(temp_wav) - audio.export(filename, format=use_audio_format) + audio.export(new_filename, format=use_audio_format) os.remove(temp_wav) filename = new_filename except (CouldntDecodeError, CouldntEncodeError) as e: