waygraph / Voice
Interface: Voice
Defined in: src/runtime/voice.ts:15
What speaks a demo's lines: an id (the cache key, with the text), the audio file's extension, and how to make one.
Properties
env?
readonlyoptionalenv?: readonlyEnvVariable[]
Defined in: src/runtime/voice.ts:25
The variables it reads (an API key): waygraph install lists them in the project's .env files.
ext
readonlyext:string
Defined in: src/runtime/voice.ts:19
"wav", "mp3"... what synthesize writes.
id
readonlyid:string
Defined in: src/runtime/voice.ts:17
Changes when the voice would sound different: a cached line is reused only for the same id and text.
Methods
close()?
optionalclose():Promise<void>
Defined in: src/runtime/voice.ts:23
Stops what the voice keeps running between lines (a model loaded once), when the recording is done.
Returns
Promise<void>
install()?
optionalinstall(opts):Promise<void>
Defined in: src/runtime/voice.ts:29
Downloads what the voice needs (a model), once per machine: waygraph install calls it.
Parameters
opts
log
(line) => void
update?
boolean
Returns
Promise<void>
missing()?
optionalmissing():string|undefined
Defined in: src/runtime/voice.ts:27
Why the voice can't speak on this machine yet (not installed), or undefined when it can.
Returns
string | undefined
synthesize()
synthesize(
text,out):Promise<void>
Defined in: src/runtime/voice.ts:21
Writes text, spoken, to the file out.
Parameters
text
string
out
string
Returns
Promise<void>