We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 91fea47 + 3116c9e commit 1affd55Copy full SHA for 1affd55
CircuitPython_Essentials/CircuitPython_Audio_Out_Tone.py
@@ -13,7 +13,7 @@
13
length = 8000 // frequency
14
sine_wave = array.array("H", [0] * length)
15
for i in range(length):
16
- sine_wave[i] = int((1 + math.sin(math.pi * 2 * i / 18)) * tone_volume * (2 ** 15))
+ sine_wave[i] = int((1 + math.sin(math.pi * 2 * i / length)) * tone_volume * (2 ** 15 - 1))
17
18
audio = audioio.AudioOut(board.A0)
19
sine_wave_sample = audioio.RawSample(sine_wave)
0 commit comments