Search page titles, headings and text across the docs.

Rust crates

canvist_dictation

The wire protocol for dictation in canvist: the messages a client and a dictation relay exchange over one WebSocket. The relay (canvist_dictation_relay) and every Rust client binding share these types, so they cannot drift apart.

  • Client to relay: start (language, context, polish), audio as binary frames of 16-bit little-endian PCM, mono, at 16 kHz, then stop.
  • Relay to client: ready, partial drafts that replace a segment’s text, one final per segment in segment order, error with a code and whether it is fatal, and done.

It depends only on serde and serde_json.

use canvist_dictation::ClientMessage;
use canvist_dictation::RelayMessage;

let start = ClientMessage::Start {
	language: Some("en".to_owned()),
	context: None,
	polish: true,
};
let json = start.to_json();

match RelayMessage::from_json(r#"{"type":"partial","segment":0,"text":"hello"}"#)? {
	RelayMessage::Partial { segment, text } => println!("draft {segment}: {text}"),
	_ => {}
}
# Ok::<(), serde_json::Error>(())

The protocol and the design behind it are in docs/internal/dictation.md.

Docs