|
5 | 5 |
|
6 | 6 | This module makes the micro:bit talk, sing and make other speech like sounds. |
7 | 7 | By default sound output will be via the edge connector on pin 0 and the |
8 | | -built-in speaker **V2**. You can connect a wired headphones or a speaker to |
9 | | -pin 0 and GND on the edge connector to hear the sound: |
| 8 | +:doc:`built-in speaker <speaker>` **V2**. You can connect wired headphones or |
| 9 | +a speaker to pin 0 and GND on the edge connector to hear the sound: |
10 | 10 |
|
11 | 11 | .. image:: speech.png |
12 | 12 |
|
@@ -46,32 +46,27 @@ Functions |
46 | 46 | emphasis. |
47 | 47 |
|
48 | 48 | .. py:function:: pronounce(phonemes, \*, pitch=64, speed=72, mouth=128, throat=128) |
49 | | - pronounce(phonemes, \*, pitch=64, speed=72, mouth=128, throat=128, pin=(pin_speaker, pin0)) |
| 49 | + pronounce(phonemes, \*, pitch=64, speed=72, mouth=128, throat=128, pin=pin0) |
50 | 50 |
|
51 | 51 | Pronounce the phonemes in the string ``phonemes``. See below for details of |
52 | 52 | how to use phonemes to finely control the output of the speech synthesiser. |
53 | 53 | Override the optional pitch, speed, mouth and throat settings to change the |
54 | 54 | timbre (quality) of the voice. |
55 | 55 |
|
56 | | - As with the music module, you can use an optional argument to specify the |
57 | | - output pin can be used to override the default of ``microbit.pin0``. |
58 | | - If you have the latest micro:bit **V2**, you can use |
59 | | - ``microbit.pin_speaker``. |
60 | | - |
61 | | - The pin argument can also take a tuple of two pins, for example |
62 | | - ``pin=(pin_speaker, pin0)`` which would output sound on the built-in |
63 | | - speaker and pin 0. |
| 56 | + For micro:bit **V2** an optional argument to specify the output pin can be |
| 57 | + used to override the default of ``pin0``. If we do not want any sound to |
| 58 | + play out of the pins can use ``pin=None``. |
64 | 59 |
|
65 | 60 | .. py:function:: say(words, \*, pitch=64, speed=72, mouth=128, throat=128) |
66 | | - say(words, \*, pitch=64, speed=72, mouth=128, throat=128, pin=(pin_speaker, pin0)) |
| 61 | + say(words, \*, pitch=64, speed=72, mouth=128, throat=128, pin=pin0) |
67 | 62 |
|
68 | 63 | Say the English words in the string ``words``. The result is semi-accurate |
69 | 64 | for English. Override the optional pitch, speed, mouth and throat |
70 | 65 | settings to change the timbre (quality) of the voice. This is a short-hand |
71 | 66 | equivalent of: ``speech.pronounce(speech.translate(words))`` |
72 | 67 |
|
73 | 68 | .. py:function:: sing(phonemes, \*, pitch=64, speed=72, mouth=128, throat=128) |
74 | | - sing(phonemes, \*, pitch=64, speed=72, mouth=128, throat=128, pin=(pin_speaker, pin0)) |
| 69 | + sing(phonemes, \*, pitch=64, speed=72, mouth=128, throat=128, pin=pin0) |
75 | 70 |
|
76 | 71 | Sing the phonemes contained in the string ``phonemes``. Changing the pitch |
77 | 72 | and duration of the note is described below. Override the optional pitch, |
|
0 commit comments