From ca0af132056ba879da751c42b1f99e2da4dfb8f3 Mon Sep 17 00:00:00 2001 From: Garry Proshian <98213116+proshian@users.noreply.github.com> Date: Wed, 30 Jul 2025 14:04:18 +0300 Subject: [PATCH] Fix: migrate from `ndarray.tostring` to `tobytes` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `ndarray.tostring()` method was deprecated in NumPy 1.19.0 and completely removed in NumPy 2.3. Since `tobytes()` has been the recommended replacement since 1.9.0 (with identical functionality), this change ensures compatibility with newer NumPy versions. The change: - Maintains the exact same behavior - Future-proofs the code against NumPy ≥2.3 --- sphfile/sphfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphfile/sphfile.py b/sphfile/sphfile.py index 6ab55dd..1075526 100644 --- a/sphfile/sphfile.py +++ b/sphfile/sphfile.py @@ -128,7 +128,7 @@ def write_wav(self, filename, start=None, stop=None): data = self.time_range(start, stop) else: data = self.content - fh.writeframes(data.tostring()) + fh.writeframes(data.tobytes()) return filename def write_sph(self, filename, start=None, stop=None,extra_headers=None):