Package 

Class Runtime

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    
    public final class Runtime
     implements AutoCloseable
                        

    Per-conversation Essence runtime. Holds the audio-history buffer for STFT framing + the source-video cursor.

    NOT THREAD-SAFE — confine each Runtime to a single thread. Share the parent Fixture across runtimes instead.

    • Constructor Detail

    • Method Detail

      • tick

         final Integer tick(FloatArray audioPCM)

        v0 tick: returns the KNN cluster_idx for the embedding produced by audioPCM. Input length must equal fixture.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 -1 to let the runtime cursor advance by 1 (wraps at sourceFrameCount).
      • pushAudio

         final Unit pushAudio(FloatArray audioPCM, Integer offset, Integer length)

        Push new PCM samples (16 kHz mono float32) into the streaming buffer. Cost is O(length) — independent of how much has already been pushed.

        Safe to interleave with pullFrame from the same thread; for cross- thread use, the caller must serialize push/pull.

      • 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.