The audio object of Web Audio API.
| Name | Type | Description | 
|---|---|---|
| url | string | The url of the audio file | 
Members
- The pan of the audio
- The pitch of the audio
- The url of the audio file
- The volume of the audio
Methods
- Adds a callback function that will be called when the audio data is loadedName Type Description listnerfunction The callback function 
- Adds a callback function that will be called when the playback is stoppedName Type Description listnerfunction The callback function 
- Clears the audio data
- Destroys the audio
- Performs the audio fade-inName Type Description durationnumber Fade-in time in seconds 
- Performs the audio fade-outName Type Description durationnumber Fade-out time in seconds 
- Checks whether a loading error has occurredReturns:Type Description boolean True if a loading error has occurred 
- Checks whether the audio is playingReturns:Type Description boolean True if the audio is playing 
- Checks whether the audio data is ready to playReturns:Type Description boolean True if the audio data is ready to play 
- Plays the audioName Type Description loopboolean Whether the audio data play in a loop offsetnumber The start position to play in seconds 
- Tries to load the audio again
- Gets the seek position of the audio
- Stops the audio
- Initializes the audio systemReturns:Type Description boolean True if the audio system is available 
- Sets the master volume for all audioName Type Description valuenumber The master volume (0 to 1)