Command Palette

Search for a command to run...

Hectal
Phase 11: Files, Images and Voice
AI Frontend · Exercise 3 of 5 PreviousNext
Intermediate

Say Why the Microphone Failed

The page tries to open a stand-in microphone in five situations chosen with the #case menu. Write describe(outcome) which returns the sentence for #say. outcome is "ok", "unsupported", or the name of the error the browser would raise.

Use exactly: ok gives Listening…; unsupported gives Voice input is not available here. You can type.; NotAllowedError gives The microphone is blocked. Allow it in the site settings.; NotFoundError gives No microphone found.; NotReadableError gives The microphone is in use by another app.; anything else gives The microphone could not start..

What Check tests

  1. Allowed shows Listening…
  2. Blocked tells the person where to allow it
  3. No microphone and busy have their own sentences
  4. A missing API says voice input is not available
  5. An unknown error gets the default sentence

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.