From 5d553297c910aacfbcf63783040f2c3c11538a54 Mon Sep 17 00:00:00 2001 From: Pufferfish101007 <50246616+pufferfish101007@users.noreply.github.com> Date: Sat, 20 Jul 2024 15:15:55 +0100 Subject: [PATCH] use self.nchannels such that it is defined fixes an error in AudioStretch.save --- src/audiostretchy/stretch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audiostretchy/stretch.py b/src/audiostretchy/stretch.py index f82e642..3c16588 100644 --- a/src/audiostretchy/stretch.py +++ b/src/audiostretchy/stretch.py @@ -152,7 +152,7 @@ def save_mp3(self, audio_file: BinaryIO, bit_rate: int = 128, quality: int = 5): encoder.set_channels(self.nchannels) encoder.set_quality(quality) encoder.set_mode( - mp3.MODE_STEREO if nchannels == 2 else mp3.MODE_SINGLE_CHANNEL + mp3.MODE_STEREO if self.nchannels == 2 else mp3.MODE_SINGLE_CHANNEL ) encoder.write(self.pcm) except ImportError: