Expand description
Screen reader and text-to-speech output. Available as ctx.speech.
The engine tries these outputs in order and uses the first one that works:
- prism (feature
prism, on by default). It talks to the running screen reader (NVDA, JAWS, VoiceOver, Orca, …) or falls back to the system voice (SAPI / OneCore, AVSpeech, speech-dispatcher, …). - VoiceOver or the system voice (macOS, feature
macos). Speaks through VoiceOver announcements when VoiceOver is on, otherwise throughAVSpeechSynthesizer. - The console. Everything is printed, so the game always keeps working.
Speech runs on its own thread, so speaking never blocks your game loop.
Speech::voices lists the voices of the system voice output and Speech::set_voice
picks one. Screen readers keep the voice the player chose in the screen reader.
Structs§
- Speech
- Speech and braille output. Reach it through
ctx.speech. - Voice
- A voice that
Speech::set_voicecan switch to. Get the list withSpeech::voices.