Resource handler used for loading Sound resources.

Hierarchy (view full)

Properties

Accessors

Methods

Properties

_app: AppBase

The running app instance.

handlerType: string = ''

Type of the resource the handler handles.

Accessors

Methods

  • Private

    Loads an audio asset using an AudioContext by URL and calls success or error with the created resource or error respectively.

    Parameters

    • url: string

      The url of the audio asset.

    • success: Function

      Function to be called if the audio asset was loaded or if we just want to continue without errors even if the audio is not loaded.

    • error: Function

      Function to be called if there was an error while loading the audio asset.

    Returns void

  • The open function is passed the raw resource data. The handler can then process the data into a format that can be used at runtime. The base implementation simply returns the data.

    Parameters

    • url: string

      The URL of the resource to open.

    • data: any

      The raw resource data passed by callback from ResourceHandler#load.

    • Optional asset: Asset

      Optional asset that is passed by ResourceLoader.

    Returns any

    The parsed resource data.