-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public final class Runtime implements AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description private final LongticksAvailable
-
Method Summary
Modifier and Type Method Description final LonggetTicksAvailable()final Integertick(FloatArray audioPCM)v0 tick: returns the KNN cluster_idxfor the embedding produced by audioPCM.final ComposeResulttickCompose(FloatArray audioPCM, Integer frameIdxHint, ByteArray frameOut)v1 compose tick: produces a composited BGR uint8 frame written into frameOut. final UnitpushAudio(FloatArray audioPCM, Integer offset, Integer length)Push new PCM samples (16 kHz mono float32) into the streaming buffer. final ComposeResultpullFrame(ByteArray frameOut, Integer frameIdxHint)Pull one composed BGR frame from the streaming buffer. final UnitresetStream()Drop accumulated streaming state (mel buffer, STFT overlap, preemphasis history, cursor). Unitclose()-
-
Constructor Detail
-
Runtime
Runtime(Fixture fixture)
-
-
Method Detail
-
getTicksAvailable
final Long getTicksAvailable()
-
tick
final Integer tick(FloatArray audioPCM)
v0 tick: returns the KNN
cluster_idxfor the embedding produced by audioPCM. Input length must equalfixture.info.audioSamplesPerTick(640 = 16 kHz / 25 fps).
-
tickCompose
final ComposeResult tickCompose(FloatArray audioPCM, Integer frameIdxHint, ByteArray frameOut)
v1 compose tick: produces a composited BGR uint8 frame written into frameOut. Buffer length must be at least
fixture.info.frameBytes.- Parameters:
frameIdxHint- pin to a specific base frame, or-1to let the runtime cursor advance by 1 (wraps atsourceFrameCount).
-
pushAudio
final Unit pushAudio(FloatArray audioPCM, Integer offset, Integer length)
-
pullFrame
final ComposeResult pullFrame(ByteArray frameOut, Integer frameIdxHint)
Pull one composed BGR frame from the streaming buffer. Throws BithumanException with
BE_ERR_AUDIO_FORMATif no tick is ready — check ticksAvailable first or wait until more audio has been pushed.
-
resetStream
final Unit resetStream()
Drop accumulated streaming state (mel buffer, STFT overlap, preemphasis history, cursor). Cheap — does not unload the model. Call between conversations or on disconnect.
-
-
-
-