api/builtins/Speaker: add speech

This commit is contained in:
Laurens Valk
2019-12-09 14:15:43 +01:00
parent be1522ad04
commit 893b23ce90
2 changed files with 35 additions and 1 deletions
+11 -1
View File
@@ -82,9 +82,19 @@
# Play a sound file from your project folder
ev3.speaker.play('mysound.wav')
.. todo:: The following functionality is not yet implemented
.. automethod:: pybricks._instances.speaker.say
.. todo:: The following functionality is not yet implemented
.. automethod:: pybricks._instances.speaker.set_voice_settings
.. todo:: This functionality is not yet implemented
.. rubric:: Using the screen
.. todo:: SCREEN IS NOT YET UPDATED / IMPLEMENTED
.. todo:: This functionality is not yet implemented
.. ::
+24
View File
@@ -388,6 +388,30 @@ class Speaker():
pass
def say(self, text):
"""Say a given text string.
Arguments:
text (str): What to say.
"""
pass
def set_voice_settings(self, language='en', speed=150, variant='m1'):
"""Configure voice settings used by the ``say`` method.
Arguments:
language (str)::
- ``'en'`` (English)
- ``'nl'`` (Dutch)
- ``'de'`` (German)
- TODO: Add all available/supported languages
speed (int): Number of words per minute.
variant (str): Voice variant. You can choose female voices
(``'f1'`` to ``'f5'``) or male voices (``'m1'`` to ``'m7'``).
"""
pass
class Light():
"""Control a single-color light."""