Skip to content

Commit a10c61e

Browse files
committed
Fixed issue with code in docs for audioio
Removed incorrect arg from RawSample in AudioOut example code. Replaced variable sample with dac.
1 parent a405892 commit a10c61e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

shared-bindings/audioio/AudioOut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@
6565
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15)
6666
//|
6767
//| dac = audioio.AudioOut(board.SPEAKER)
68-
//| sine_wave = audioio.RawSample(sine_wave, mono=True, sample_rate=8000)
68+
//| sine_wave = audioio.RawSample(sine_wave, sample_rate=8000)
6969
//| dac.play(sine_wave, loop=True)
7070
//| time.sleep(1)
71-
//| sample.stop()
71+
//| dac.stop()
7272
//|
7373
//| Playing a wave file from flash::
7474
//|

shared-bindings/audioio/RawSample.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
//| sine_wave = audioio.RawSample(sine_wave)
7171
//| dac.play(sine_wave, loop=True)
7272
//| time.sleep(1)
73-
//| sample.stop()
73+
//| dac.stop()
7474
//|
7575
STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
7676
mp_arg_check_num(n_args, n_kw, 1, 2, true);

0 commit comments

Comments
 (0)