Back to Whisper Cpp

wchess : voice

examples/wchess/wchess.wasm/index-tmpl.html

1.8.42.1 KB
Original Source

wchess : voice-controlled chess using Whisper + WebAssembly

This is a demonstration of using Whisper to recognize voice commands in the browser.

Usage:

  • Select a Whisper model
  • Accept the microphone permission request if prompted
  • Hold the button and say a chess move (e.g. "Knight to c3")
  • Release the button and wait for the move to be recognized
  • Repeat

Examples:

  • "d4"
  • "e2 e4"
  • "Knight f3"
  • "Bishop to b5"

Features:

  • Model quantization for reduced memory footprint (~42MB)
  • Grammar-based sampling for improved recognition accuracy

Note that not all chess moves are supported. For example, castling and pawn promotion currently do not work, but can be easily implemented. There could also be some bugs in the move handling logic in general. The main reason for that is to keep the implementation simple. The assumption is that a real application would already have a proper move validation logic in place.

The main purpose of this example is to demonstrate the capabilities of whisper.cpp and its application in the browser for voice recognition locally on your device.

You can find more about this project on GitHub.

More examples: main | bench | stream | command |


Whisper model: tiny.en (Q8_0, 42 MB)

Clear browser cache

Status: select model Hold

[The grammar will be displayed here]
[The moves will be displayed here]

Debug output:
Troubleshooting

The page does some heavy computations, so make sure:

  • To use a modern web browser (e.g. Chrome, Firefox)
  • Your browser supports WASM Fixed-width SIMD

| Build time: @GIT_DATE@ | Commit hash: @GIT_SHA1@ | Commit subject: @GIT_COMMIT_SUBJECT@ | Source Code |