Interface AmplifiedMedia

Returned from amplifyMedia

AmplifiedMedia

interface AmplifiedMedia {
    amplify: ((multiplier) => void);
    context: AudioContext;
    gain: GainNode;
    getAmpLevel: (() => number);
    media: HTMLMediaElement;
    source: MediaElementAudioSourceNode;
}

Properties

amplify: ((multiplier) => void)

A function which takes a multiplier (amplification level) and sets the media’s volume to that level.

Type declaration

    • (multiplier): void
    • A function which takes a multiplier (amplification level) and sets the media’s volume to that level.

      Parameters

      • multiplier: number

      Returns void

context: AudioContext

An instance of AudioContext which was used to change the media’s volume.

gain: GainNode

A media gain created from the AudioContext instance and the mediaElem. This may be useful if you desire to do more with the web audio API regarding this media.

getAmpLevel: (() => number)

A function which returns the multiplier (amplification level).

Type declaration

    • (): number
    • A function which returns the multiplier (amplification level).

      Returns number

media: HTMLMediaElement

A reference to the mediaElem passed into the function.

source: MediaElementAudioSourceNode

A media source created from the AudioContext instance and the mediaElem. This may be useful if you desire to do more with the web audio API regarding this media. NOTE: Only one source node can be created from an element.

Generated using TypeDoc