The gateway's fixed local speech engines and their shared asynchronous job lifecycle.
The gateway's fixed local speech engines and their shared asynchronous job lifecycle.
(default-engine direction)The configured engine for direction, falling back to its first built-in.
The configured engine for `direction`, falling back to its first built-in.
How each direction reads in a line a human is shown.
How each direction reads in a line a human is shown.
(direction-phases direction)The phases ONE direction actually walks, in order: the shared vocabulary without the
other direction's working phase. A surface that advertises transcription therefore
never promises :synthesizing to a client that would wait for it.
The phases ONE direction actually walks, in order: the shared vocabulary without the other direction's working phase. A surface that advertises transcription therefore never promises `:synthesizing` to a client that would wait for it.
Is this one of the two directions of speech?
Is this one of the two directions of speech?
The two directions of speech, in the order a human meets them: audio in, audio out. Each is also the KEY its engines carry their work fn under.
The two directions of speech, in the order a human meets them: audio in, audio out. Each is also the KEY its engines carry their work fn under.
(engine direction id)The direction engine with id, or nil.
The `direction` engine with `id`, or nil.
Optional operator override for each independent direction.
Optional operator override for each independent direction.
(engines direction)The fixed engines for direction, loaded when speech is first queried or used.
The fixed engines for `direction`, loaded when speech is first queried or used.
(engines-info direction)One direction's engine catalogue as capabilities data: what exists and what is
selected. A SPEAKING engine also carries the voices a caller may name, so
/v1/capabilities populates a picker in one request instead of a call per engine.
A catalogue that REFUSES leaves :voices absent rather than empty: an empty vector
means "one fixed voice, nothing to choose", so a broken engine must not be reported
as a silent one — and it must not take the whole capabilities response down with it.
One direction's engine catalogue as capabilities data: what exists and what is selected. A SPEAKING engine also carries the voices a caller may name, so `/v1/capabilities` populates a picker in one request instead of a call per engine. A catalogue that REFUSES leaves `:voices` absent rather than empty: an empty vector means "one fixed voice, nothing to choose", so a broken engine must not be reported as a silent one — and it must not take the whole capabilities response down with it.
(env-engine-id direction)The engine id named by the direction's environment variable, or nil.
The engine id named by the direction's environment variable, or nil.
(error-message t)One readable line for a Throwable: the DEEPEST cause's own sentence, so an
opaque wrapper (ExecutionException: java.lang.RuntimeException: no model)
never hides the line a human needs.
One readable line for a Throwable: the DEEPEST cause's own sentence, so an opaque wrapper (`ExecutionException: java.lang.RuntimeException: no model`) never hides the line a human needs.
(forget! id)Drop a job (a client that collected its transcript need not wait for the TTL). A spoken reply's audio goes with it — see [[discard-dropped-audio!]].
Drop a job (a client that collected its transcript need not wait for the TTL). A spoken reply's audio goes with it — see [[discard-dropped-audio!]].
(forget-voice! engine id)Delete an imported voice by id. True when there was one to delete, false when the engine never had it - a caller deleting a voice twice is not an error.
Delete an imported voice by id. True when there was one to delete, false when the engine never had it - a caller deleting a voice twice is not an error.
(import-voice! engine clip)Hand engine a recording and get back the voice it became, in the shape every
surface reports. clip is {:path :voice-name :language :text}, where :text is
the clip's own transcript when the caller knows it.
An engine that cannot learn a voice REFUSES BY NAME rather than silently doing nothing: cloning is a property of the engine, and a caller that asked the wrong one deserves to be told which one it asked.
Hand `engine` a recording and get back the voice it became, in the shape every
surface reports. `clip` is `{:path :voice-name :language :text}`, where `:text` is
the clip's own transcript when the caller knows it.
An engine that cannot learn a voice REFUSES BY NAME rather than silently doing
nothing: cloning is a property of the engine, and a caller that asked the wrong one
deserves to be told which one it asked.(job-audio-path id)The file a finished SYNTHESIS job wrote, or nil. Host-side only: this is how the
gateway streams the audio back, and it is deliberately absent from public-job.
The file a finished SYNTHESIS job wrote, or nil. Host-side only: this is how the gateway streams the audio back, and it is deliberately absent from [[public-job]].
Is this a phase of the shared vocabulary?
Is this a phase of the shared vocabulary?
Every phase of speech work, in order, both directions together. :uploading is
client-side (the bytes are in flight, the gateway has no job yet); a stored job
starts at :queued.
Every phase of speech work, in order, both directions together. `:uploading` is client-side (the bytes are in flight, the gateway has no job yet); a stored job starts at `:queued`.
(prepare! engine)(prepare! engine {:keys [voice-id] :as opts})Ask an engine, or one named voice, to start making itself ready.
Ask an engine, or one named voice, to start making itself ready.
(public-engine engine)One engine in the shape every surface reports. :is-voice-import is a
CAPABILITY, not a preference: it is the app's answer to whether it may offer
"add a voice" at all.
One engine in the shape every surface reports. `:is-voice-import` is a CAPABILITY, not a preference: it is the app's answer to whether it may offer "add a voice" at all.
(public-job job)A job in the shape every surface reads. The audio path never leaves: a recording is the client's own upload, and a spoken reply is FETCHED from the gateway rather than named to the caller.
A job in the shape every surface reads. The audio path never leaves: a recording is the client's own upload, and a spoken reply is FETCHED from the gateway rather than named to the caller.
(public-sample sample)What a play button may promise for this voice, in the wire vocabulary: a sample it can play NOW, one that a press would first make out of very little, or - when neither - nothing at all, because the honest answer to "can I hear this voice" is sometimes "install it first".
What a play button may promise for this voice, in the wire vocabulary: a sample it can play NOW, one that a press would first make out of very little, or - when neither - nothing at all, because the honest answer to "can I hear this voice" is sometimes "install it first".
(public-voice voice)One voice in the wire vocabulary, including terms needed for explicit opt-in.
One voice in the wire vocabulary, including terms needed for explicit opt-in.
(readiness engine)(readiness engine {:keys [voice-id]})What an engine says about its ability to work right now. With a :voice-id, ask
the optional per-voice callback instead of the engine default.
What an engine says about its ability to work right now. With a `:voice-id`, ask the optional per-voice callback instead of the engine default.
(ready? engine)Can this engine take work right now?
Can this engine take work right now?
(resolve-engine direction id)The direction engine for an explicit id (nil selects the default).
The `direction` engine for an explicit `id` (nil selects the default).
(submit! direction {:keys [on-done] :as request})Accept one piece of speech work — a recording to :transcribe, a line of text to
:synthesize — and return the QUEUED job immediately, so the caller answers 202 and
the human is told the server took it. The engine runs on its own thread; on-done
(optional) receives the final public job and is where a temp file is deleted.
An unknown engine is refused HERE, before a job exists, so the caller can answer 400 rather than inventing a job that instantly fails.
Accept one piece of speech work — a recording to `:transcribe`, a line of text to `:synthesize` — and return the QUEUED job immediately, so the caller answers 202 and the human is told the server took it. The engine runs on its own thread; `on-done` (optional) receives the final public job and is where a temp file is deleted. An unknown engine is refused HERE, before a job exists, so the caller can answer 400 rather than inventing a job that instantly fails.
(submit-sync! direction {:keys [on-done] :as request})submit! without the thread — the same job lifecycle run inline. Tests and
any caller that wants determinism use this.
[[submit!]] without the thread — the same job lifecycle run inline. Tests and any caller that wants determinism use this.
(synthesize! {:keys [engine-id on-progress] :as request})Speak text through the resolved synthesis engine on THIS thread, reporting
{:phase :progress} to on-progress. Returns the file the engine wrote —
{:audio-path :media-type :bytes …} — which the CALLER owns and deletes.
Speak `text` through the resolved synthesis engine on THIS thread, reporting
`{:phase :progress}` to `on-progress`. Returns the file the engine wrote —
`{:audio-path :media-type :bytes …}` — which the CALLER owns and deletes.(transcribe! {:keys [engine-id on-progress] :as request})Run audio-path through the resolved transcription engine on THIS thread, reporting
{:phase :progress} to on-progress. Returns the transcript.
Run `audio-path` through the resolved transcription engine on THIS thread, reporting
`{:phase :progress}` to `on-progress`. Returns the transcript.(voice-sample engine voice-id)Where this engine's sample of voice-id is, WITHOUT making one: {:audio-path …}, {:is-preparable true}, or nil - including for an engine that declares no
sample seam, because a voice nobody can play back is not an error.
Where this engine's sample of `voice-id` is, WITHOUT making one: `{:audio-path
…}`, `{:is-preparable true}`, or nil - including for an engine that declares no
sample seam, because a voice nobody can play back is not an error.(voice-sample! engine voice-id)The sample WAV for voice-id - {:audio-path :media-type} - or nil when this
voice has none to give.
It MAKES one when the engine said that was cheap, so a press of play is answered by audio rather than by a second request: what an engine calls preparable is by contract small (a sample pack next to the weights) or local (speaking one sentence with a model already installed), never the voice download itself. A press of play is not consent to 115 MB.
The sample WAV for `voice-id` - `{:audio-path :media-type}` - or nil when this
voice has none to give.
It MAKES one when the engine said that was cheap, so a press of play is
answered by audio rather than by a second request: what an engine calls
preparable is by contract small (a sample pack next to the weights) or local
(speaking one sentence with a model already installed), never the voice
download itself. A press of play is not consent to 115 MB.(voices engine)The voices engine can speak in, with per-voice readiness when it declares that
seam, and per-voice sample facts when it declares that one.
The voices `engine` can speak in, with per-voice readiness when it declares that seam, and per-voice sample facts when it declares that one.
(watch! job-id f)Call f with the public job on every change until the returned fn is called.
Call `f` with the public job on every change until the returned fn is called.
The phase an engine spends its own time in, per direction.
The phase an engine spends its own time in, per direction.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |