File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Introducing_CircuitPlaygroundExpress Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 34
34
audio = AudioOut (board .SPEAKER )
35
35
sine_wave_sample = RawSample (sine_wave )
36
36
37
- audio .play (sine_wave_sample , loop = True ) # Keep playing the sample over and over
38
- time .sleep (1 ) # until...
39
- audio .stop () # We tell the board to stop
37
+ # A single sine wave sample is hundredths of a second long. If you set loop=False, it will play
38
+ # a single instance of the sample (a quick burst of sound) and then silence for the rest of the
39
+ # duration of the time.sleep(). If loop=True, it will play the single instance of the sample
40
+ # continuously for the duration of the time.sleep().
41
+ audio .play (sine_wave_sample , loop = True ) # Play the single sine_wave sample continuously...
42
+ time .sleep (1 ) # for the duration of the sleep (in seconds)
43
+ audio .stop () # and then stop.
You can’t perform that action at this time.
0 commit comments