Class AudioModule

This subclass is for playing single audio. This class enables to create audio player that has higher features than HTMLAudioElement. But, this class is disadvantage to play many one shot audios. In that case, developer should use OneshotModule.

Hierarchy (View Summary)

Constructors

Properties

analyser: Analyser
autopanner: Autopanner
bitcrusher: BitCrusher
chorus: Chorus
compressor: Compressor
context: AudioContext
delay: Delay
envelopegenerator: EnvelopeGenerator
equalizer: Equalizer
filter: Filter
flanger: Flanger
fuzz: Fuzz
listener: Listener
mastervolume: GainNode
mixed: boolean = false
modules: Connectable[] = []
noisegate: NoiseGate
noisesuppressor: NoiseSuppressor
overdrive: OverDrive
panner: Panner
phaser: Phaser
pitchshifter: PitchShifter
preamp: Preamp
processor: AudioWorkletNode
recorder: Recorder
reverb: Reverb
ringmodulator: Ringmodulator
runningAnalyser: boolean = false
stereo: Stereo
tremolo: Tremolo
vocalcanceler: VocalCanceler
wah: Wah
NUMBER_OF_INPUTS: 2
NUMBER_OF_OUTPUTS: 2

Accessors

Methods

  • This method connects AudioNodes.

    Parameters

    • source: AudioNode

      This argument is AudioNode as sound source.

    Returns void

  • This method gets or sets fade-in time.

    Parameters

    • Optionaltime: number

      This argument is fade-in time. If this argument is omitted, this method is getter.

    Returns number | AudioModule

    Return value is fade-in time. Otherwise, return value is for method chain.

  • This method gets or sets fade-out time.

    Parameters

    • Optionaltime: number

      This argument is fade-out time. If this argument is omitted, this method is getter.

    Returns number | AudioModule

    Return value is fade-out time. Otherwise, return value is for method chain.

  • This method gets instance of AudioBufferSourceNode.

    Returns AudioBufferSourceNode

  • This method determines whether instance of AudioBuffer exists.

    Returns boolean

    If instance of AudioBuffer already exists, this value is true. Otherwise, this value is false.

  • This method re-initials modules.

    Parameters

    • context: AudioContext

      This argument is in order to use Web Audio API.

    Returns void

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "analyser"

      This argument selects module.

    Returns Analyser

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "recorder"

      This argument selects module.

    Returns Recorder

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "autopanner"

      This argument selects module.

    Returns Autopanner

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "bitcrusher"

      This argument selects module.

    Returns BitCrusher

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "chorus"

      This argument selects module.

    Returns Chorus

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "compressor"

      This argument selects module.

    Returns Compressor

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "delay"

      This argument selects module.

    Returns Delay

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "envelopegenerator"

      This argument selects module.

    Returns EnvelopeGenerator

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "equalizer"

      This argument selects module.

    Returns Equalizer

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "filter"

      This argument selects module.

    Returns Filter

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "flanger"

      This argument selects module.

    Returns Flanger

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "fuzz"

      This argument selects module.

    Returns Fuzz

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "listener"

      This argument selects module.

    Returns Listener

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "noisegate"

      This argument selects module.

    Returns NoiseGate

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "noisesuppressor"

      This argument selects module.

    Returns NoiseSuppressor

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "overdrive"

      This argument selects module.

    Returns OverDrive

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "panner"

      This argument selects module.

    Returns Panner

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "phaser"

      This argument selects module.

    Returns Phaser

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "pitchshifter"

      This argument selects module.

    Returns PitchShifter

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "preamp"

      This argument selects module.

    Returns Preamp

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "reverb"

      This argument selects module.

    Returns Reverb

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "ringmodulator"

      This argument selects module.

    Returns Ringmodulator

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "stereo"

      This argument selects module.

    Returns Stereo

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "tremolo"

      This argument selects module.

    Returns Tremolo

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "vocalcanceler"

      This argument selects module.

    Returns VocalCanceler

  • This method gets instance of Module (Analyser, Recorder, Effector ... etc).

    Parameters

    • moduleName: "wah"

      This argument selects module.

    Returns Wah

  • This method gets or sets parameters for audio module. This method is overloaded for type interface and type check.

    Parameters

    • params: "mastervolume"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for audio module if getter. Otherwise, return value is for method chain.

  • This method gets or sets parameters for audio module. This method is overloaded for type interface and type check.

    Parameters

    • params: "playbackRate"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for audio module if getter. Otherwise, return value is for method chain.

  • This method gets or sets parameters for audio module. This method is overloaded for type interface and type check.

    Parameters

    • params: "detune"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for audio module if getter. Otherwise, return value is for method chain.

  • This method gets or sets parameters for audio module. This method is overloaded for type interface and type check.

    Parameters

    • params: "loop"

      This argument is string if getter. Otherwise, setter.

    Returns boolean

    Return value is parameter for audio module if getter. Otherwise, return value is for method chain.

  • This method gets or sets parameters for audio module. This method is overloaded for type interface and type check.

    Parameters

    • params: "currentTime"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for audio module if getter. Otherwise, return value is for method chain.

  • This method gets or sets parameters for audio module. This method is overloaded for type interface and type check.

    Parameters

    • params: "duration"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for audio module if getter. Otherwise, return value is for method chain.

  • This method gets or sets parameters for audio module. This method is overloaded for type interface and type check.

    Parameters

    • params: "sampleRate"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for audio module if getter. Otherwise, return value is for method chain.

  • This method gets or sets parameters for audio module. This method is overloaded for type interface and type check.

    Parameters

    • params: "numberOfChannels"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for audio module if getter. Otherwise, return value is for method chain.

  • This method gets or sets parameters for audio module. This method is overloaded for type interface and type check.

    Parameters

    • params: "numberOfChannels"

      This argument is string if getter. Otherwise, setter.

    Returns number

    Return value is parameter for audio module if getter. Otherwise, return value is for method chain.

  • This method gets or sets parameters for audio module. This method is overloaded for type interface and type check.

    Parameters

    Returns AudioModule

    Return value is parameter for audio module if getter. Otherwise, return value is for method chain.

  • This method determines whether audio is paused.

    Returns boolean

    If audio is paused, this value is true. Otherwise, this value is false.

  • This method decodes instance of ArrayBuffer to ArrayBuffer or sets instanceof AudioBuffer.

    Parameters

    • buffer: ArrayBuffer | AudioBuffer

      This argument is instance of ArrayBuffer or AudioBuffer. If this is ArrayBuffer, this method executes decode.

    Returns AudioModule

    Return value is for method chain.

  • This method sets up envelope generator for fade-in and fade-out.

    Parameters

    • Optionalcallbacks: {
          decodeCallback(buffer: AudioBuffer): void;
          endedCallback(source: AudioBufferSourceNode, currentTime: number): void;
          errorCallback(error: Error): void;
          updateCallback(source: AudioBufferSourceNode, currentTime: number): void;
      }

    Returns AudioModule

    Return value is for method chain.

  • This method slices instance of AudioBuffer.

    Parameters

    • OptionalstartTime: number

      This argument is start time [sec] on AudioBuffer.

    • OptionalendTime: number

      This argument is end time [sec] on AudioBuffer.

    Returns null | AudioBuffer

    Return value is sliced AudioBuffer.

  • This method sprites audio.

    Parameters

    • sprites: { [spriteName: string]: [number, number] }

      This argument is associative array that contains sprite times.

    Returns null | AudioBufferSprite

    Return value is associative array that contains sprited AudioBuffer.

  • This method starts audio from designated time.

    Parameters

    • OptionalstartTime: number

      This argument is time that audio is started at. The default value is 0.

    • OptionalendTime: number

      This argument is time that audio is ended at. The default value is audio duration.

    Returns AudioModule

    This is returned for method chain.