Class R.sound.HTML5
Extends
R.sound.AbstractSoundSystem.
Initializes the HTML5 sound system. The sound types supported by the HTML5 sound system
are determined by file extension on the URL:
- mp3 - Audio MP3 format (Safari, Chrome, IE9)
- aac - Apple's AAC format (Safari)
- ogg - Ogg Vorbis format (Firefox, Chrome, Opera)
- pcm - WebM audio-only format (Firefox)
- wav - Wave audio format (Firefox, Safari, Opera, IE9)
Defined in: html5.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
destroySound(sound)
Destroy the given sound object
|
|
getSoundDuration(sound)
Get the length (duration) of the sound object, in milliseconds
|
|
getSoundPosition(sound)
Get the position, in milliseconds, within a playing or paused sound
|
|
getSoundReadyState(sound)
Determine if the sound object is ready to be used
|
|
getSoundSize(sound)
Get the size of the sound object, in bytes (unsupported in HTML5)
|
|
muteSound(sound)
Mute the given sound object
|
|
pauseSound(sound)
Pause the given sound object
|
|
playSound(sound)
Play the given sound object
|
|
resumeSound(sound)
Resume the given sound object
|
|
setSoundPan(sound, pan)
Pan the given sound object from left to right (unsupported in HTML5)
|
|
setSoundPosition(sound, millisecondOffset)
Set the position, within the sound's length, to play at
|
|
setSoundVolume(sound, volume)
Set the volume of the given sound object
|
|
stopSound(sound)
Stop the given sound object
|
|
unmuteSound(sound)
Unmute the given sound object
|
|
verifyType(mime)
Verify if the given type can be played
|
- Methods borrowed from class R.sound.AbstractSoundSystem:
- isReady, loadSound, shutdown
Method Detail
destroySound(sound)
Destroy the given sound object
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
{Number}
getSoundDuration(sound)
Get the length (duration) of the sound object, in milliseconds
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
- Returns:
- {Number}
{Number}
getSoundPosition(sound)
Get the position, in milliseconds, within a playing or paused sound
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
- Returns:
- {Number}
{Boolean}
getSoundReadyState(sound)
Determine if the sound object is ready to be used
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
- Returns:
- {Boolean}
true
if the sound is ready
{Number}
getSoundSize(sound)
Get the size of the sound object, in bytes (unsupported in HTML5)
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
- Returns:
- {Number}
muteSound(sound)
Mute the given sound object
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
pauseSound(sound)
Pause the given sound object
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
playSound(sound)
Play the given sound object
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
resumeSound(sound)
Resume the given sound object
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
setSoundPan(sound, pan)
Pan the given sound object from left to right (unsupported in HTML5)
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
- pan
- {Number} A value between -100 and 100, with -100 being full left and zero being center
setSoundPosition(sound, millisecondOffset)
Set the position, within the sound's length, to play at
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
- millisecondOffset
- {Number} The millisecond offset from the start of the sounds duration
setSoundVolume(sound, volume)
Set the volume of the given sound object
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
- volume
- {Number} A value between 0 and 100, with 0 being muted
stopSound(sound)
Stop the given sound object
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
unmuteSound(sound)
Unmute the given sound object
- Parameters:
- sound
- {R.resources.types.Sound} The sound object
verifyType(mime)
Verify if the given type can be played
- Parameters:
- mime