11Speech
22------
33
4- .. warning ::
5-
6- WARNING! THIS IS ALPHA CODE.
7-
8- We reserve the right to change this API as development continues.
9-
10- The quality of the speech is not great, merely "good enough". Given the
11- constraints of the device you may encounter memory errors and / or
12- unexpected extra sounds during playback. It's early days and we're
13- improving the code for the speech synthesiser all the time. Bug reports
14- and pull requests are most welcome.
15-
164Computers and robots that talk feel more "human".
175
186So often we learn about what a computer is up to through a graphical user
@@ -42,9 +30,14 @@ In any case, we're going to create a DALEK poetry recital on demand.
4230Say Something
4331+++++++++++++
4432
45- Before the device can talk you need to plug in a speaker like this:
33+ If you have the latest micro:bit **V2 ** device, you can use the built-in
34+ speaker as well as or instead of connecting a speaker or set of headphones
35+ like this:
4636
47- .. image :: ../speech.png
37+ .. image :: pin0-gnd.png
38+ :width: 250px
39+ :align: center
40+ :alt: piezo connected to pin0 and GND
4841
4942The simplest way to get the device to speak is to import the ``speech `` module
5043and use the ``say `` function like this::
@@ -58,10 +51,10 @@ change some of the parameters that the speech synthesiser uses to produce the
5851voice. Our speech synthesiser is quite powerful in this respect because we can
5952change four parameters:
6053
61- * ``pitch `` - how high or low the voice sounds (0 = high, 255 = Barry White )
62- * ``speed `` - how quickly the device talks (0 = impossible , 255 = bedtime story )
63- * ``mouth `` - how tight-lipped or overtly enunciating the voice sounds (0 = ventriloquist's dummy , 255 = Foghorn Leghorn )
64- * ``throat `` - how relaxed or tense is the tone of voice (0 = falling apart , 255 = totally chilled )
54+ * ``pitch `` - how high or low the voice sounds (0 = high, 255 = low )
55+ * ``speed `` - how quickly the device talks (0 = fast , 255 = slow )
56+ * ``mouth `` - how tight-lipped or overtly enunciating the voice sounds (0 = closed mouth , 255 = open mouth )
57+ * ``throat `` - how relaxed or tense is the tone of voice (0 = tense , 255 = relaxed )
6558
6659Collectively, these parameters control the quality of sound - a.k.a. the
6760timbre. To be honest, the best way to get the tone of voice you want is to
0 commit comments