Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.speech.core

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.
raw docstring

default-engineclj

(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.
sourceraw docstring

direction-nounsclj

How each direction reads in a line a human is shown.

How each direction reads in a line a human is shown.
sourceraw docstring

direction-phasesclj

(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.
sourceraw docstring

direction?clj

Is this one of the two directions of speech?

Is this one of the two directions of speech?
sourceraw docstring

directionsclj

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.
sourceraw docstring

engineclj

(engine direction id)

The direction engine with id, or nil.

The `direction` engine with `id`, or nil.
sourceraw docstring

engine-env-varsclj

Optional operator override for each independent direction.

Optional operator override for each independent direction.
sourceraw docstring

enginesclj

(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.
sourceraw docstring

engines-infoclj

(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.
sourceraw docstring

env-engine-idclj

(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.
sourceraw docstring

error-messageclj

(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.
sourceraw docstring

forget!clj

(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!]].
sourceraw docstring

forget-voice!clj

(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.
sourceraw docstring

import-voice!clj

(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.
sourceraw docstring

jobclj

(job id)

The public job for id, or nil.

The public job for `id`, or nil.
sourceraw docstring

job-audio-pathclj

(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]].
sourceraw docstring

phase?clj

Is this a phase of the shared vocabulary?

Is this a phase of the shared vocabulary?
sourceraw docstring

phasesclj

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`.
sourceraw docstring

prepare!clj

(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.
sourceraw docstring

public-engineclj

(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.
sourceraw docstring

public-jobclj

(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.
sourceraw docstring

public-sampleclj

(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".
sourceraw docstring

public-voiceclj

(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.
sourceraw docstring

readinessclj

(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.
sourceraw docstring

ready?clj

(ready? engine)

Can this engine take work right now?

Can this engine take work right now?
sourceraw docstring

reset-jobs!clj

(reset-jobs!)

Forget every job (tests).

Forget every job (tests).
sourceraw docstring

resolve-engineclj

(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).
sourceraw docstring

submit!clj

(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.
sourceraw docstring

submit-sync!clj

(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.
sourceraw docstring

synthesize!clj

(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.
sourceraw docstring

terminal-phasesclj

Phases a job never leaves.

Phases a job never leaves.
sourceraw docstring

transcribe!clj

(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.
sourceraw docstring

voice-sampleclj

(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.
sourceraw docstring

voice-sample!clj

(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.
sourceraw docstring

voicesclj

(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.
sourceraw docstring

watch!clj

(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.
sourceraw docstring

work-phasesclj

The phase an engine spends its own time in, per direction.

The phase an engine spends its own time in, per direction.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close