Audio Class

Extends Resource
Module: Resources

Audio class is used to store audio data as a arraybuffer to be later used by objects with the WebAudio API.

Constructor

Audio

(
  • url
  • encoding
)

Parameters:

  • url ArrayBuffer, String

    URL to Audio file or ArrayBuffer data.

  • encoding String

    Audio encoding (mp3, wav, etc).

Item Index

Methods

Methods

fileIsAudio

(
  • file
)
Boolean static

Check if a file name refers to a supported audio file.

Parameters:

  • file File

Returns:

Boolean:

True if the file refers to a supported audio format.

toJSON

(
  • meta
)
Object

Serialize audio data as json.

Audio data is serialized in Base64.

Parameters:

  • meta Meta

Returns:

Object:

data