From 8510b02038727f204ea670a6b2d0c22e9d303c87 Mon Sep 17 00:00:00 2001 From: Brad Alexander <10731572+brad-alexander@users.noreply.github.com> Date: Tue, 27 Dec 2022 17:32:19 -0800 Subject: [PATCH] [docs] Coerce linspace to int numpy==1.24.1 simpleaudio==1.0.4 --- docs/tutorial.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorial.rst b/docs/tutorial.rst index b6ce222..11adc31 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -95,7 +95,7 @@ Here is a full example that plays a few sinewave notes in succession:: # get timesteps for each sample, T is note duration in seconds sample_rate = 44100 T = 0.25 - t = np.linspace(0, T, T * sample_rate, False) + t = np.linspace(0, T, int(T * sample_rate), False) # generate sine wave notes A_note = np.sin(A_freq * t * 2 * np.pi) @@ -136,7 +136,7 @@ in one speaker than the other, 'panning' it to one side or the other. The full e # get timesteps for each sample, T is note duration in seconds sample_rate = 44100 T = 0.5 - t = np.linspace(0, T, T * sample_rate, False) + t = np.linspace(0, T, int(T * sample_rate), False) # generate sine wave notes A_note = np.sin(A_freq * t * 2 * np.pi) @@ -183,7 +183,7 @@ the packed 24-bit audio to be played:: # get timesteps for each sample, T is note duration in seconds sample_rate = 44100 T = 0.5 - t = np.linspace(0, T, T * sample_rate, False) + t = np.linspace(0, T, int(T * sample_rate), False) # generate sine wave tone tone = np.sin(440 * t * 2 * np.pi)