From bfe912e41aaac9d893e1f652be8af759ea1e769b Mon Sep 17 00:00:00 2001 From: James Pine Date: Fri, 13 Mar 2026 04:34:26 -0700 Subject: [PATCH] fix: specify WAV format for atomic save temp file soundfile cannot infer format from .tmp extension, causing all generations to fail with 'No format specified and unable to get format from file extension' --- backend/utils/audio.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/utils/audio.py b/backend/utils/audio.py index ab60d0a5..2c6de760 100644 --- a/backend/utils/audio.py +++ b/backend/utils/audio.py @@ -92,8 +92,9 @@ def save_audio( # Ensure parent directory exists Path(path).parent.mkdir(parents=True, exist_ok=True) - # Write to temporary file first - sf.write(temp_path, audio, sample_rate) + # Write to temporary file first (explicit format since .tmp + # extension is not recognised by soundfile) + sf.write(temp_path, audio, sample_rate, format='WAV') # Atomic rename to final path os.replace(temp_path, path)