Skip to content

About

A voice receptionist demo: Web Speech in, spoken replies out, a real reservation state machine, and an engine log that shows its work

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Night Desk

Night Desk is a voice receptionist demo I built for a fictional late-night diner called Marlow's. It is here to show that I can build a real voice interface, not a mockup of one. Talk to it or type to it, and it answers back, out loud, in the browser.

What it is

Marlow's is invented: no real restaurant, no real address, no real phone number. Night Desk is the phone desk voice for it. It can tell you the hours, give directions, walk through the menu and prices, book you a table, change or cancel a reservation, take a callback message, or hand you off to a human. Everything happens in one HTML file, with no server and no AI API calls behind it.

How it works

  • Speech in: the Web Speech API's SpeechRecognition (with the webkitSpeechRecognition fallback for Chrome/Edge) turns your voice into text while you hold the bell button down. You'll see the words appear as interim text while you're still talking.
  • Speech out: replies are read back with speechSynthesis, the browser's built-in text-to-speech. There's a mute button if you'd rather just read.
  • The brain: a small local conversation engine, hand-written in plain JavaScript. No calls out to an LLM or any API. It reads your text (spoken or typed), matches it to an intent with pattern matching, and runs a real state machine for anything multi-step, like booking a table: it asks for party size, then day, then time, then your name, re-asks whatever you skipped or gave unclearly, recaps the whole thing, and only locks it in once you say yes.
  • The engine log: the panel next to the chat is not decoration. For every turn, it shows the intent Night Desk detected, the slots it has filled so far, and what state the conversation is in. It's there so you can watch the state machine actually work, not just trust that it does.
  • Graceful fallback: if your browser doesn't support SpeechRecognition, or you say no to the microphone prompt, Night Desk notices and switches itself to typing only, with a plain status line explaining what happened. The bell button disables itself. Everything else, including the state machine and the spoken replies, keeps working. You never need a microphone to use this.

How to run it

It's one file, index.html, with the CSS and JavaScript inline. No build step, no npm install, no dependencies.

The simplest way: double-click index.html and it opens in your browser. Typing will work immediately. Voice input may or may not, depending on your browser; see below.

For the full voice experience, serve it over a local static server instead of opening it directly as a file:// page, since some browsers restrict microphone access on file URLs. Any static server works. A couple of options if you have the tools installed:

# Python 3
python -m http.server 8000

# Node, via npx
npx serve .

Then open http://localhost:8000 (or whatever port your server prints) in your browser.

Browser support

  • Best experience: Chrome or Edge on desktop, both voice input and voice output work.
  • Voice output only: Safari and Firefox support speechSynthesis, but not SpeechRecognition (or only partially), so Night Desk will fall back to typed input while still speaking its replies out loud.
  • Typed only: any modern browser. The conversation engine and the engine log work identically whether you type or talk.
  • Voice input needs a secure context (https:// or localhost) and microphone permission. If either is missing, Night Desk explains itself in the status line and switches to typing.

Known limitations

  • The name and phone number capture is a simple text parser, not real NLU. It handles ordinary phrasing fine ("my name is Dana", "555 123 4567") but can be thrown off by unusual input.
  • "Cancel or change my reservation" always finds a reservation. The lookup is a stand-in for a real database: it makes up a plausible-looking table (day, time, party size) from whatever name or number you give it, consistently for that name, so it's convincing to demo but not connected to anything real.
  • Speech recognition accuracy depends entirely on the browser's engine; Night Desk doesn't do any of its own audio processing.
  • No data is stored or sent anywhere. Refreshing the page clears the whole conversation.

Don Florencio github.com/workflo17

About

A voice receptionist demo: Web Speech in, spoken replies out, a real reservation state machine, and an engine log that shows its work

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages