Z.Audio
Inherits from Z.Base
Description
The Z.Audio object plays back and audio file. The following audio formats are supported:
- WAV
- OGG
The following recommendations are made to minimize download times and CPU usage:
- Prefer OGG for files longer than one second
- Use single channel "mono" audio files
- Use a sample rate of 22.05 KHz
For more information on using audio in ZapWorks Studio visit the Audio article.
Example
var myaudio = Z.Audio("moby.ogg");
myaudio.start();
Provided by Z.Audio
Constructor
Z.Audio(...) | Constructs a new Z.Audio object. |
Events
finish | Emitted when the audio has finished playing. |
Functions
pause( ) | Pauses playback at the current seek position. |
restart( ) | Restarts playback from the start of the audio file. |
source( ) | Returns the filename or URL of the audio file. |
source(...) | Sets the filename or URL of the audio file. |
start( ) | Continues playback from the current seek position. |
volume( ) | Gets the volume of the audio object. |
volume(...) | Sets the volume of the audio object. |
Inherited from Z.Base
Functions
emit(...) | Calls the handler functions attached to an event. |
hasTag(...) | Returns true if this object has the specified tag. |
off(...) | Removes a handler function from an event. |
on(...) | Attaches a handler function to an event. |
one(...) | Attaches a single-use handler function to an event. |
pushTag(...) | Adds a tag to this object. |
removeTag(...) | Removes a tag from this object. |
tags( ) | Gets an array of the tags that this object belongs to. |
tags(...) | Sets the array of the tags that this object belongs to. |