Talking Sorting Hat

Challenge

In the Harry Potter films, the actor Leslie Phillips voiced the sorting hat. Modify the sorting hat code to speak aloud what it’s thinking before announcing to the student instead of writing scrolling text on the screen. Most text should translate immediately but you may need to investigate phonemes to pronounce the Hogwarts houses correctly.

Requirements

Extensions

Refer to the speech API for details: https://microbit-micropython.readthedocs.io/en/latest/speech.html

Example Solution


from microbit import *
import speech

# using default speech settings
speech.say("I am the sorting hat")
# set individual speech qualities - values 0 to 255
speech.say("I am the sorting hat", speed=82, pitch=72, throat=110, mouth=105)