forked from Jibo-Revival-Group/JiboOs
34 lines
1.4 KiB
JavaScript
34 lines
1.4 KiB
JavaScript
/**
|
|
* Utilities that work with sounds.
|
|
* @class SoundUtils
|
|
* @memberof jibo.sound
|
|
*/
|
|
|
|
/**
|
|
* Create a new sound for a sine wave-based tone.
|
|
* @method jibo.sound.SoundUtils.sineTone
|
|
* @param {jibo.sound.SoundContext} soundContext
|
|
* @param {Number} hertz Frequency of sound.
|
|
* @param {Number} seconds Duration of sound in seconds.
|
|
* @return {jibo.sound.Sound} New sound.
|
|
*/
|
|
|
|
/**
|
|
* Create a new "Audio" stream based on given audio path and project uri; returns the audio object.
|
|
* @method jibo.sound.SoundUtils.playOnce
|
|
* @static
|
|
* @param {String} fileName Full path of the file to play.
|
|
* @param {Function} callback Callback when complete.
|
|
* @return {string} New audio element alias.
|
|
*/
|
|
|
|
/**
|
|
* Setup sounds to play automatically when hitting a frame label. For instance, a frame label of "playAudio-pop"
|
|
* will play the sound alias "pop" and "playAudio-breeze-1" will play the sound alias "breeze".
|
|
* @method jibo.sound.SoundUtils.addClipSounds
|
|
* @static
|
|
* @param {PIXI.animate.MovieClip} clip MovieClip to add sounds.
|
|
* @param {String} [labelPrefix=playAudio] Label name should start with this.
|
|
* @param {String} [separator=-] The separater between the labelPrefix, sound alias and the unique id (for playing multiple times)
|
|
* @return {PIXI.animate.MovieClip} MoveClip
|
|
*/ |