Alba Habla
I’ve been a parent for a few years now and have spent countless hours thinking (read: worrying) about how my kids interact with technology. As a person whose work & primary hobby are the same (programming computers), my kids see me posted up in front of a laptop frequently and I want to take away any mystery of what I’m doing.
When my daughter, Alba, was about 18 months old, she started telling me that she also “needed to do some work on the computer.” I didn’t want to say no (I wanted to encourage her curiosity) so I opened a new terminal window and started showing her the say
program that came with my MacBook. If you’re unfamiliar, say
is a speech synthesizer. You enter a command like say "hello"
and some dude’s voice says “hello” out of your speakers.
After a few rounds of me typing funny say
commands, I thought it would be pretty straightforward to write a script that would allow her to type whatever she wanted without prefixing it with “say” or having to surround it in quotes - essentially a REPL for say
. I also thought it would be great to have her interacting on the command line like I do (I’m always in a terminal window).
So one night after I put her to bed, I wrote the script. It was a hit! Every day she would ask me, “can I type, Daddy?” At first she just liked to smash the keys and get the voice to sound funny. After a while, though, she started asking me how to spell words (“mummy”, “daddy”, “alba”, etc.) until one day I was making a coffee and heard the computerized voice of a Scottish woman in the living room say “alba love daddy”. She had typed her first sentence ❤️
After a few weeks of use came the first feature request: “can you make it read my books, Daddy?” So I added the read
subcommand, which was pretty simple: open a text file and for each line in it, print the words to the screen and send them to say
. The hardest part was trying to type all of The Cat in the Hat into vim with a child standing behind me asking if it was ready every 7 seconds (we’ve all had managers like that, right?).
The second feature request was one I’m sure parents get all the time: “can you make it work on linux too, Daddy?” Alba didn’t really phrase it like that, but we have an old netbook running Ubuntu and she wanted to play on it. To make this happen I had to figure out if there was a standard speech synthesizer on linux and what it was. Evidently there is and it is called espeak. So now, if your system doesn’t have say
, Alba Habla will fall back to espeak
. Hurray for multiple platforms!
Alba is 3.5 now and plays it less and less - she prefers making videos of herself singing about how much she loves her little brother and then emails them to her grandparents, but I think this program has really helped her connect the dots on a handful of things:
- She is now comfortable typing.
- She understands concepts like
backspace
/delete
&enter
. - She understands what the
shift
key is and how we use it to make big letters (but not CAPS LOCK as that’s mapped toctrl
on all my machines). - She understands that holding
command
and pressing another key usually does something interesting; specifically+
/-
for increasing/decreasing text size &cmd + k
for clearing the terminal screen. - She knows what a space is (in terms of a space bar). Think about that for a second. We teach kids the alphabet but they aren’t properly introduced to the concept of whitespace until they get to a keyboard.
- She knows that Daddy can “write code” to make things (and that she can learn to code as well)
- She learned that you can make computers say silly stuff 😝
For anyone who wants to try about Alba Habla, check out the code on github. The README includes install/setup instructions.