-
- All Implemented Interfaces:
-
app.rive.AssetOps
public class AudioAsset.Companion implements AssetOps<AudioHandle, AudioAsset>
-
-
Method Summary
Modifier and Type Method Description final Result<AudioAsset>fromBytes(CommandQueue commandQueue, ByteArray bytes)Create and decode an audio asset from the given byte array on the provided command queue. AudioHandledecode(CommandQueue queue, ByteArray bytes)Decode the asset from the given byte array on the provided command queue. Unitdelete(CommandQueue queue, AudioHandle handle)Delete the asset from the provided command queue. Unitregister(CommandQueue queue, String key, AudioHandle handle)Register the asset with the provided command queue under the given key. Unitunregister(CommandQueue queue, String key)Unregister the asset from the provided command queue for the given key. AudioAssetconstruct(AudioHandle handle, CommandQueue queue)Construct the asset instance from the given handle, key, and command queue. StringgetTag()The tag used for logging purposes. StringgetLabel()A label for the asset type, used in logging. -
-
Method Detail
-
fromBytes
final Result<AudioAsset> fromBytes(CommandQueue commandQueue, ByteArray bytes)
Create and decode an audio asset from the given byte array on the provided command queue.
The audio can only be used on the same CommandQueue it was created on.
Must be registered with AudioAsset.register to be used for referenced audio.
- Parameters:
commandQueue- The command queue that owns the audio.bytes- The byte array containing the audio data to decode.
-
decode
AudioHandle decode(CommandQueue queue, ByteArray bytes)
Decode the asset from the given byte array on the provided command queue.
-
delete
Unit delete(CommandQueue queue, AudioHandle handle)
Delete the asset from the provided command queue.
-
register
Unit register(CommandQueue queue, String key, AudioHandle handle)
Register the asset with the provided command queue under the given key.
-
unregister
Unit unregister(CommandQueue queue, String key)
Unregister the asset from the provided command queue for the given key.
-
construct
AudioAsset construct(AudioHandle handle, CommandQueue queue)
Construct the asset instance from the given handle, key, and command queue.
-
-
-
-