A single Audio File suitable for loading by the Loader.
These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly.
For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio.
new HTML5AudioFile(loader, key, [urlConfig], [xhrSettings])
A reference to the Loader that is responsible for this file.
|key||string | Phaser.Types.Loader.FileTypes.AudioFileConfig||
The key to use for this file, or a file configuration object.
The absolute or relative URL to load this file from.
Extra XHR Settings specifically for this file.
Updated as the file loads. Only set if loading via XHR.
The total size of this file. Set by onProgress and only if loading via XHR.
A reference to the Cache, or Texture Manager, that is going to store this file if it loads.
A config object that can be used by file types to store transitional data.
For CORs based loading. If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set)
The processed file data, stored here after the file has loaded.
Unique cache key (unique within its file type)
Does this file have an associated linked file? Such as an image and a normal map. Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't actually bound by data, where-as a linkFile is.
A reference to the Loader that is going to load this file.
If this is a multipart file, i.e. an atlas and its json together, then this is a reference to the parent MultiFile. Set and used internally by the Loader or specific file types.
A percentage value between 0 and 1 indicating how much of this file has loaded. Only set if loading via XHR.
The final URL this file will load from, including baseURL and path. Set automatically when the Loader calls 'load' on this file.
The current state of the file. One of the FILE_CONST values.
The file type string (image, json, etc) for sorting within the Loader.
The URL of the file, not including baseURL.
Automatically has Loader.path prepended to it if a string.
The XMLHttpRequest instance (as created by XHR Loader) that is loading this File.
The merged XHRSettings for this file.
Adds this file to its target cache upon successful loading and processing. This method is often overridden by specific file types.
Destroy this File and any references it holds.
Checks if a key matching the one used by this file exists in the target Cache or not. This is called automatically by the LoaderPlugin to decide if the file can be safely loaded or will conflict.
true if adding this file will cause a conflict, otherwise
Called by the Loader, starts the actual file downloading. During the load the methods onLoad, onError and onProgress are called, based on the XHR events. You shouldn't normally call this method directly, it's meant to be invoked by the Loader.
Called if the file errors while loading.
Called when the file finishes loading.
Usually overridden by the FileTypes and is called by Loader.nextFile. This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage.
Called when the File has completed processing. Checks on the state of its multifile, if set.
Called when the File has completed processing but it generated an error. Checks on the state of its multifile, if set.
Called during the file load progress. Is sent a DOM ProgressEvent.
Called once the file has been added to its cache and is now ready for deletion from the Loader.
It will emit a
filecomplete event from the LoaderPlugin.
Resets the XHRLoader instance this file is using.
Links this File with another, so they depend upon each other for loading and processing.
The file to link to this one.