Tina's ITP Blog

ITP Blog

The Laugh Bot

For my first assignment in Hello Computer, I was tasked to create something that takes non-speech input from a person and responds with speech synthesis. I made the Laugh Bot, a bot that laughs at your friends’ lame jokes, so you wouldn’t have to!

Try the Laugh Bot: https://hgs0k.csb.app/


My brainstorming process started with listing down the different types of non-speech inputs I could implement on a web browser.

 
Screen Shot 2563-11-04 at 00.08.50.png
 

My two ideas that stuck with me were

  1. Temperature slider that triggers the browser to say things out “Ouch, that’s hot!” or “Brr… it’s

  2. A bot that laughs at lame jokes for you

I went with idea 2, as it was easier to implement and has potential usage in social settings.

I picked a color scheme and designed my interface on Adobe Illustrator.

Screen Shot 2563-11-04 at 00.45.42.png

My code was pretty straight-forward for desktop. I used the speechSynthesis interface of the Web Speech API, as instructed by our teacher Nicole He. I created an array of strings and loop through them with each click. Realizing that speechSynthesis doesn’t work on my mobile browser, I was informed by my classmate Zeyao Li to add some code to silently trigger the speech once at the beginning by clicking, then removing the event listener.

I also made the bot’s face change to a nervous laugh when it is being pressed, using mouseup/mousedown events for desktop and touchstart/touchend events for mobile. Thank you Zeyao for helping me debug!

This project was my first try at creating voice interaction. I’m excited to continue to explore this realm of technology and create more weird and funny stuff for people to play with!

Github repo: https://github.com/falsesugar/laugh-bot