GenServer that manages a Python OmniVoice bridge via Erlang Port.
Protocol
Frame format: [4-byte BE total_length][msgpack-encoded payload]
Audio is WAV bytes inside msgpack — no base64.
Operations
init— Load model from HuggingFacegenerate— TTS synthesis (synchronous, returns full audio)ping— Health check
Summary
Functions
Waits for the model to finish loading.
Returns a specification to start this module under a supervisor.
Returns runtime model info: device, sample_rate, status.
Gracefully stops the GenServer and the Python bridge process.
Types
@type generate_opt() :: {:ref_audio, String.t()} | {:ref_text, String.t()} | {:instruct, String.t()} | {:language, String.t()} | {:duration, float()} | {:speed, float()} | {:num_step, pos_integer()} | {:guidance_scale, float()} | {:seed, non_neg_integer()} | {:position_temperature, float()} | {:class_temperature, float()}
@type start_opts() :: [model_option()]
Functions
@spec await_ready(GenServer.server(), timeout()) :: :ok | {:error, term()}
Waits for the model to finish loading.
Returns :ok when ready, {:error, :loading} if still initializing,
or {:error, reason} if initialization failed.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec generate(GenServer.server(), String.t(), [generate_opt()]) :: {:ok, binary()} | {:error, term()}
@spec generate(GenServer.server(), String.t(), [generate_opt()], timeout()) :: {:ok, binary()} | {:error, term()}
@spec info(GenServer.server()) :: map()
Returns runtime model info: device, sample_rate, status.
@spec start_link(start_opts()) :: GenServer.on_start()
@spec stop(GenServer.server()) :: :ok
Gracefully stops the GenServer and the Python bridge process.