File tree Expand file tree Collapse file tree
shared-bindings/audiocore Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232//| :param ~circuitpython_typing.ReadableBuffer buffer: A buffer with samples
3333//| :param int channel_count: The number of channels in the buffer
3434//| :param int sample_rate: The desired playback sample rate
35- //| :param bool single_buffer: Selects single buffered or double buffered transfer mode. This affects sample looping
36- //| and what happens if the sample buffer is changed while the sample is playing.
37- //| In single buffered transfers, samples will play once unless the play method is invoked with
38- //| loop=True. A change in buffer contents will not affect active playback.
39- //| In double buffered transfers, samples are always looped, and changed buffer contents will
40- //| be played back as soon as transfer reaches the next half-buffer point.
35+ //| :param bool single_buffer: Selects single buffered or double buffered transfer mode. This affects
36+ //| what happens if the sample buffer is changed while the sample is playing.
37+ //| In single buffered transfers, a change in buffer contents will not affect active playback.
38+ //| In double buffered transfers, changed buffer contents will
39+ //| be played back when the transfer reaches the next half-buffer point.
4140//|
4241//| Playing 8ksps 440 Hz and 880 Hz sine waves::
4342//|
6968//|
7069//| # Play double-buffered
7170//| sample = audiocore.RawSample(sine_wave, single_buffer=False)
72- //| pwm.play(sample)
71+ //| pwm.play(sample, loop=True )
7372//| time.sleep(3)
7473//| # changing the wave takes effect almost immediately
7574//| for i in range(length):
You can’t perform that action at this time.
0 commit comments