waud.js
API Docs for v1.0.3
Show:

WaudBase64Pack

Summary

Class to load multiple base64 packed sounds from JSON.

Constructor

WaudBase64Pack

Syntax

WaudBase64Pack

(
  • url
  • [options]
  • [onLoaded]
  • [onProgress]
  • [onError]
  • [options]
  • [sequentialLoad]
)

Summary

Parameters:

  • url String
    • Base64 packed JSON file.
  • [options] WaudSoundOptions optional
    • Sound options.
  • [onLoaded] IWaudSound> -> Void optional
    • on load callback.
  • [onProgress] Float -> Void optional
    • on progress callback.
  • [onError] Void -> Void optional
    • on error callback.
  • [options] WaudSoundOptions optional
    • Sound options.
  • [sequentialLoad] Bool optional
    • To create and decode sounds sequentially instead of concurrently.

Example:

    var base64pack = new WaudBase64Pack("assets/sounds.json", _onLoad, _onProgress, _onError);

    function _onLoad(snds:Map<String, IWaudSound>) {
        snds.get("assets/beep.mp3").play();
    }

    function _onProgress(val:Float, loaded:Float) {
        trace("loaded %: " + (val * 100));
    }

    function _onError() {
        trace("error loading base64 json file");
    }

Item Index

Methods

_createSound

Syntax

_createSound

(
  • id
)
private

Summary

Function to create base64 sound.

Parameters:

_loadBase64Json

Syntax

_loadBase64Json

(
  • url
)
private

Summary

Function to load Base64 JSON.

Parameters:

  • url String
    • Base64 JSON path.