Merge pull request #2965 from jepler/sine-wave-examples

Various doc examples:  Fix the "/ 18" copypasta bug
This commit is contained in:
sommersoft 2020-05-27 20:24:36 -05:00 committed by GitHub
commit f72d166e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@
//| length = 8000 // 440 //| length = 8000 // 440
//| sine_wave = array.array("H", [0] * length) //| sine_wave = array.array("H", [0] * length)
//| for i in range(length): //| for i in range(length):
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
//| //|
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) //| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
//| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9) //| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9)

View File

@ -61,7 +61,7 @@
//| length = 8000 // 440 //| length = 8000 // 440
//| sine_wave = array.array("h", [0] * length) //| sine_wave = array.array("h", [0] * length)
//| for i in range(length): //| for i in range(length):
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15)) //| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15))
//| //|
//| dac = audioio.AudioOut(board.SPEAKER) //| dac = audioio.AudioOut(board.SPEAKER)
//| sine_wave = audiocore.RawSample(sine_wave) //| sine_wave = audiocore.RawSample(sine_wave)

View File

@ -61,7 +61,7 @@
//| length = 8000 // 440 //| length = 8000 // 440
//| sine_wave = array.array("H", [0] * length) //| sine_wave = array.array("H", [0] * length)
//| for i in range(length): //| for i in range(length):
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
//| //|
//| dac = audioio.AudioOut(board.SPEAKER) //| dac = audioio.AudioOut(board.SPEAKER)
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) //| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)

View File

@ -63,7 +63,7 @@
//| length = 8000 // 440 //| length = 8000 // 440
//| sine_wave = array.array("H", [0] * length) //| sine_wave = array.array("H", [0] * length)
//| for i in range(length): //| for i in range(length):
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
//| //|
//| dac = audiopwmio.PWMAudioOut(board.SPEAKER) //| dac = audiopwmio.PWMAudioOut(board.SPEAKER)
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) //| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)