pub struct TtsEngine { /* private fields */ }Expand description
Blocking public engine facade.
The runtime is owned below this facade and is never exposed to callers. Admission uses an atomic lease, so no mutex is held across CPU work and one engine never runs more than one synthesis fanout at a time.
Implementations§
Source§impl TtsEngine
impl TtsEngine
Sourcepub fn new(config: EngineConfig) -> Result<Self, EngineError>
pub fn new(config: EngineConfig) -> Result<Self, EngineError>
Creates an engine with explicit, validated limits.
Sourcepub fn from_process_environment() -> Result<Self, EngineError>
pub fn from_process_environment() -> Result<Self, EngineError>
Creates an engine from the process-wide environment defaults.
Sourcepub fn synthesize<P: TextPreparer + ?Sized>(
&self,
request: SynthesisRequest,
text_preparer: &P,
frame_generator: &mut dyn FrameGenerator,
cancellation: &CancellationToken,
observer: &dyn SynthesisObserver,
) -> Result<SynthesisResult, EngineError>
pub fn synthesize<P: TextPreparer + ?Sized>( &self, request: SynthesisRequest, text_preparer: &P, frame_generator: &mut dyn FrameGenerator, cancellation: &CancellationToken, observer: &dyn SynthesisObserver, ) -> Result<SynthesisResult, EngineError>
Runs one blocking synthesis: text preparation, admission, then the model decode loop.
The decode loop runs on the calling thread rather than through Self::run_stage: frame
generators borrow model weights, so they cannot cross the 'static spawn boundary, and a
per-frame deadline check is the natural budget seam for an autoregressive loop anyway.
Sourcepub fn enroll(
&self,
request: EnrollmentRequest,
cancellation: &CancellationToken,
observer: &dyn SynthesisObserver,
) -> Result<EnrollmentResult, EngineError>
pub fn enroll( &self, request: EnrollmentRequest, cancellation: &CancellationToken, observer: &dyn SynthesisObserver, ) -> Result<EnrollmentResult, EngineError>
Runs the Phase 0 enrollment shell through the owned runtime.