-
Couldn't load subscription status.
- Fork 147
Asset Class Reference
The Asset class is responsible for managing all aspects of the decoding pipeline from source to decoder. You can use the Asset class to inspect information about an audio file, such as its format, metadata, and duration, as well as actually decode the file to raw linear PCM audio data.
Creates an Asset with the specified Source.
Creates an Asset with an HTTPSource pointing to the specified url.
Creates an Asset with a FileSource pointing to the specified File.
The percentage of the audio file that has been buffered by the source.
The duration of the audio file in milliseconds.
The format object describing the audio format as returned by the demuxer.
An object containing any metadata embedded in the audio file.
A boolean indicating whether the decoding pipeline is currently active.
The backing Source object for the asset.
The backing Demuxer object for the asset, or null if demuxing hasn't started yet.
The backing Decoder object for the asset, or null if decoding hasn't started yet.
Starts the decoding process of the asset.
Pauses the decoding process of the asset.
Used for inspecting various parts of an audio file without actually decoding the entire file. event is allowed to be either 'format', 'duration', or 'metadata'. If the requested property has already been decoded at the time get is called, the callback is invoked immediately. Otherwise, the asset waits until the requested event is emitted, at which point the callback is called and decoding is stopped.
Emitted while the audio file is being loaded with a percentage between 0 and 100 representing the amount of the file that has been read so far.
Emitted when the demuxer has decoded enough information to determine basic format information about the audio file.
Emitted when the duration of the audio file has been parsed.
Emitted when any embedded metadata is decoded.
Emitted when decoding of the actual audio data begins.
Emitted when audio data is decoded. buffer is a Typed Array containing decoded Linear PCM audio.
Emitted when the an error is encountered in the decoding process. Whenever an error is encountered, the decoding process is also stopped automatically.