Skip to content

A text to speech extension for Micro:bit using Makecode

License

Notifications You must be signed in to change notification settings

adamish/pxt-billy

Repository files navigation

Billy

This is a MakeCode extension based on a port of SAM by Sebastian Macke.

SAM "Software Automatic Mouth" itself is a legendary text to speech algorithm from 1982 for the Commodore C64

Add to a MakeCode Project

This repository can be added as an extension in MakeCode.

Examples

Basic usage

input.onButtonPressed(Button.A, function () {
    billy.say("Hello World")
})

input.onButtonPressed(Button.B, function () {
    billy.say("I am a DALEK - EXTERMINATE")
})

The voice can be configured from an existing preset

input.onButtonPressed(Button.A, function () {
    billy.configureVoice(VoicePreset.Dalek)
    billy.say("I am a DALEK - EXTERMINATE")
})

The voice can be configured with individual values for speed, pitch, throat and mouth Each value is in the range of 0 to 255

  • speed - how quickly the voice talks - low value slow, high value fast
  • pitch - how high or low the voice sounds
  • throat - how relaxed or tense is the tone of voice
  • mouth - how tight-lipped the voice sounds
input.onButtonPressed(Button.A, function () {
    billy.configureVoice(92, 60, 190, 190);
    billy.say("I am a robot")
})

Advanced pronounciation can be achieved with direct use of phonemes

See original SAM manual for full details of the syntax

input.onButtonPressed(Button.A, function () {
    billy.pronounce("/HEHLOW WERLD")
})

Supported targets

  • for PXT/microbit

(The metadata above is needed for package search, update it with the targets you support)

Acknowledgements

License

MIT

Links

About

A text to speech extension for Micro:bit using Makecode

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages