From ac105d99905b12eaf2c1a162bda935556a6ea85d Mon Sep 17 00:00:00 2001 From: Diego Pereira Date: Sat, 23 Aug 2025 23:27:13 -0300 Subject: [PATCH] fix: replace fromstring (deprecated) to frombuffer --- code/thinkdsp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/thinkdsp.py b/code/thinkdsp.py index 8edfc0d13..66925c2eb 100644 --- a/code/thinkdsp.py +++ b/code/thinkdsp.py @@ -112,7 +112,7 @@ def read_wave(filename="sound.wav"): xs = np.fromstring(z_str, dtype=np.int8).astype(np.int32) ys = (xs[2::3] * 256 + xs[1::3]) * 256 + xs[0::3] else: - ys = np.fromstring(z_str, dtype=dtype_map[sampwidth]) + ys = np.frombuffer(z_str, dtype=dtype_map[sampwidth]) # if it's in stereo, just pull out the first channel if nchannels == 2: