AudioAsset class
A reference to an audio file shared with the Oooh platform
Signature:
export declare class AudioAsset extends AbstractModuleAsset
Extends: AbstractModuleAsset
Methods
Method | Modifiers | Description |
---|---|---|
delete() | Deletes the asset and any files representing it. | |
getAudioUrl() | Get a URL suitable for accessing the raw audio data in the Web Audio API. | |
getPlayableUrl() | Get a URL suitable for playing the audio. |
AudioAsset.delete() method
Deletes the asset and any files representing it.
Signature:
delete(): void;
Returns:
void
AudioAsset.getAudioUrl() method
Get a URL suitable for accessing the raw audio data in the Web Audio API.
Signature:
getAudioUrl(): Promise<string>;
Returns:
Promise<string>
A URL suitable for HTML5 Web Audio
Remarks
Returns an Object URL pointing to a Blob of the audio file's contents, for assets created by the AssetManager. This Blob is stored in memory; use AbstractModuleAsset.dispose() if you no longer need it. For remotely hosted assets, returns a regular https:// URI.
AudioAsset.getPlayableUrl() method
Get a URL suitable for playing the audio.
Signature:
getPlayableUrl(): Promise<string>;
Returns:
Promise<string>
A URL suitable for the audio tag or audio libraries
Remarks
Returns a file:// URI for assets created by the AssetManager, or a regular https:// URI for remotely hosted assets. While the security policy will prevent you from playing file URIs in the web view, they may be used in the AudioManager API, or <audio>
/ new Audio()
which have been polyfilled to use AudioManager. See more in audio.
Updated 10 months ago