Skip to content

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? ​

readonly optional env?: readonly EnvVariable[]

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 ​

readonly ext: string

Defined in: src/runtime/voice.ts:19

"wav", "mp3"... what synthesize writes.


id ​

readonly id: 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()? ​

optional close(): 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()? ​

optional install(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()? ​

optional missing(): 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>

waygraph 0.18.3 (alpha) · Node 24+ · peer @playwright/test ^1.40.0 · syntax may change before 1.0: see what was removed