load
Loads an audio resource using the specified loading method.
Return
A valid AudioResource instance if the loading succeeds; otherwise, an invalid instance will be returned.
Parameters
The name of the audio resource.
The path to the audio resource.
The loading method to use, which defaults to FROM_ASSETS.
Throws
If any error occurs during loading.
Loads an audio resource using the specified loading method, with additional configuration.
Return
A valid AudioResource instance if the loading succeeds; otherwise, an invalid instance will be returned.
Parameters
The name of the audio resource.
The path to the audio resource.
The loading method to use, which defaults to FROM_ASSETS.
The configuration for the audio resource, which is specified with AudioResourceConfig.
Throws
If any error occurs during loading.
Loads an audio resource from the specified URL.
Return
A valid AudioResource instance if the loading succeeds; otherwise, an invalid instance will be returned.
Parameters
The name of the audio resource.
The Uri of the audio resource. The supported Uri schemes are file://, content://, and android.resource://. URI schemes such as http:// and https:// are not supported.
The current Context, representing the active component or application environment from which this method is called.
Throws
If any error occurs during loading.
Loads an audio resource from the specified URI with the provided configuration.
Return
A valid instance if the loading succeeds; otherwise, an invalid instance will be returned.
Parameters
The name of the audio resource.
The Uri of the audio resource. The supported Uri schemes are file://, content://, and android.resource://. Schemes like http:// and https:// are not supported.
The current Context, representing the active component or application environment from which this method is called.
The configuration for the audio resource, which is specified with AudioResourceConfig.
Throws
If any error occurs during loading.
Loads an audio resource from the specified AssetBundle.
Return
A valid instance if the loading succeeds; otherwise, an invalid instance will be returned.
Parameters
The AssetBundle containing the audio resource.
The relative path to the audio resource in the AssetBundle.
Throws
If any error occurs during loading.