Skip to content

Commit 8c6370c

Browse files
Update src/symphonic_joules/audio.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
1 parent 64eb535 commit 8c6370c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/symphonic_joules/audio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ def save_audio(path: str, y: np.ndarray, sr: int) -> None:
8686
raise ValueError("Cannot save empty waveform")
8787

8888
try:
89-
if y.ndim == 2 and y.shape[0] < y.shape[1]:
90-
y = y.T
89+
# The docstring should clarify that the expected shape is (n_samples, n_channels).
90+
# The heuristic is removed to prevent data corruption on short, multi-channel signals.
91+
# y = y.T # This should be handled by the caller to ensure correct orientation.
9192
sf.write(path, y, sr)
9293
except Exception as e:
9394
raise RuntimeError(f"Failed to save audio file {path}: {str(e)}")

0 commit comments

Comments
 (0)