foo-webview-sdk
    Preparing search index...

    Class PcmStreamExperimental

    A live stream subscription. Poll PcmStream.read from requestAnimationFrame or a timer; the host cannot signal the page when frames arrive.

    The buffers are read-only shared memory: PcmStream.read copies frames out of them, and the class releases each buffer when its epoch is superseded or the stream ends. Frames of the previous epoch that were not read before its successor arrived are discarded with it and counted in the dropped of the next read that returns frames.

    Index
    ready: Promise<PcmStreamOutcome>

    The host's answer to the subscription. Never rejects.

    subscriptionId: string

    The id the host knows this subscription by.

    • Experimental

      Called once when the stream ends; called at once if it already has.

      Parameters

      • listener: () => void

      Returns () => void

    • Experimental

      Copy out the frames written since the previous call, one Float32Array per channel, with the number of frames the ring overwrote before they were read, or that a format change discarded, in dropped. segments says where media time restarts within the frames and what track time each run begins at.

      Returns null before the first buffer arrived, when nothing new was written (playback stopped or paused), after the stream ended, or when the host kept writing during every attempt; the next call tries again.

      Returns PcmRingRead | null

    • Experimental

      Remove the subscription on the host and free the page's view. Safe to call more than once.

      Returns void