Package 

Object AudioAsset.Companion

    • Method Detail

      • fromBytes

         final Result<AudioAsset> fromBytes(CommandQueue riveWorker, ByteArray bytes)

        Create and decode an audio asset from the given byte array on the provided Rive worker.

        The audio can only be used on the same RiveWorker it was created on.

        Must be registered with AudioAsset.register to be used for referenced audio.

        ⚠️ The lifetime of the returned audio is managed by the caller. Make sure to call close when you are done with it to release its resources. The returned audio holds a reference to riveWorker, so closing it is required before the worker can fully release memory associated with this audio.

        Parameters:
        riveWorker - The Rive worker that owns the audio.
        bytes - The byte array containing the audio data to decode.
      • getLabel

         String getLabel()

        A label for the asset type, used in logging.