-
Notifications
You must be signed in to change notification settings - Fork 287
V2 docs #692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 docs #692
Changes from 1 commit
e267646
f3407cc
656a2c2
97af5b3
2e5b2c8
9205f32
3b49c8a
198831f
f68e326
ad54991
0067550
11d1ab1
f5e4aed
218ddd6
10ab2ea
529a165
78bd241
63647a3
aa503f0
31a7722
35e1928
099b4e3
921d7ca
37da28e
4239dad
dd714cd
4846113
f30fa02
946638b
01331f3
cba5965
da4fd76
d74c7a5
09b04c0
3ae79a4
67f6a97
8c06787
8e83d9e
81ffe80
e1e8487
e22ce51
cff8eee
826e9f8
6d088b0
0081158
5aa2626
8ad485d
16146f7
33864c2
a1400f8
fadcb74
690c4b9
b954d38
8f52c97
849eb3d
6351791
acd3c9d
b3c9957
f5faefa
bbe4d05
1040971
37acd15
b20d460
9e7e33c
54e0eda
bf9721d
8fe52d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,11 @@ Audio | |
|
|
||
| .. py:module:: audio | ||
|
|
||
| This module allows you play sounds from a speaker attached to the Microbit. | ||
| In order to use the audio module you will need to provide a sound source. | ||
| This module allows you to play your own sounds. By default sound output | ||
| will be via the built-in speaker **V2** and via the edge connector on | ||
microbit-carlos marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| pin 0. You can connect a wired headphones or a speaker to pin 0 and GND | ||
| on the edge connector to hear the sounds. In order to use the audio module | ||
| you will need to provide a sound source. | ||
|
|
||
| A sound source is an iterable (sequence, like list or tuple, or a generator) of | ||
| frames, each of 32 samples. | ||
|
|
@@ -14,7 +17,7 @@ which means that it can reproduce frequencies up to 3.9kHz. | |
| Functions | ||
| ========= | ||
|
|
||
| .. py:function:: play(source, wait=True, pin=pin0, return_pin=None) | ||
| .. py:function:: play(source, wait=True, pin=pin_speaker, return_pin=None) | ||
|
||
|
|
||
| Play the source to completion. | ||
|
|
||
|
|
@@ -24,8 +27,19 @@ Functions | |
|
|
||
| ``pin`` specifies which pin the speaker is connected to. | ||
|
|
||
| ``return_pin`` specifies a differential pin to connect to the speaker | ||
| instead of ground. | ||
| As with the music module, you can use the optional ``pin`` argument to specify the | ||
microbit-carlos marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| output pin can be used to override the default of ``microbit.pin0``. | ||
| If you have the latest micro:bit, you can use ``microbit.pin_speaker`` | ||
| **V2**. | ||
|
|
||
| .. note:: | ||
| Using this argument will disable the default functionality on the | ||
microbit-carlos marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| **V2** board, so ``pin=microbit.pin0`` will only output on the | ||
| edge connector and ``pin=microbit.pin_speaker`` will only use | ||
| the built-in speaker. | ||
|
|
||
| ``return_pin`` specifies a differential edge connector pin to connect | ||
microbit-carlos marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| to an exteernal speaker instead of ground. | ||
|
|
||
| Classes | ||
| ======= | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.