Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.83 KB

api-reference.md

File metadata and controls

54 lines (40 loc) · 1.83 KB

API reference

A quick map of the public surface. Import everything top-level objects from voxavatar; everything else from its subpackage.

Top level

name what
Pipeline orchestrates ASR → LLM → TTS → visemes
PipelineConfig provider names + runtime knobs
Session conversation history + barge-in
text_to_visemes(text) one-shot text → VisemeTimeline
register_provider / get_provider / list_providers registry helpers

Providers (voxavatar.providers)

Three Protocols define what a backend must implement:

class ASRProvider(Protocol):
    name: str
    def transcribe(self, audio: AudioBuffer) -> str: ...

class LLMProvider(Protocol):
    name: str
    def complete(self, prompt: str, history=()) -> Iterator[str]: ...

class TTSProvider(Protocol):
    name: str
    def synthesize(self, text: str, sample_rate: int = 16000) -> AudioBuffer: ...

All three are @runtime_checkable, so isinstance(obj, ASRProvider) works.

Reference implementations: MockASR, EchoLLM, SineTTS — registered as "mock_asr", "echo_llm", "sine_tts". Look them up with get_provider(name); lookup is case-insensitive.

Visemes (voxavatar.visemes)

name what
OVR15 the 15 Oculus viseme names, in canonical order
phoneme_to_viseme(ph) ARPABET phoneme → OVR15 name
vowel_openness(ph) 0–1 mouth openness for a vowel
build_from_phonemes(phonemes) [Phoneme] → VisemeTimeline
VisemeTimeline.sample(t) active weights at time t (with envelope)
VisemeTimeline.to_json() serialise the track
VisemeTimeline.coarticulate(blend) overlap neighbours for smoother motion
to_arkit_frames(tl, fps) per-frame ARKit blendshape dicts
write_arkit_csv(tl, fp, fps) stream an ARKit CSV