Namespace: audio

syngen.audio

Wrapper for the main AudioContext and umbrella for all Web Audio API-related utilities.

Source:

Interfaces

binaural

Namespaces

buffer
circuit
effect
formant
mixer
ramp
shape
synth

Methods

(static) context() → {AudioContext}

Returns the main AudioContext.

Source:
Returns:
Type
AudioContext

(static) export(optionsopt) → {MediaRecorder}

Records the output of the provided input and exports it as a WebM file. When no duration is passed, the MediaRecorder must be stopped to complete the export.

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
duration Number <optional>
0
input AudioNode <optional>
syngen.audio.mixer.master.output
name String <optional>
export.webm
Source:
Returns:
Type
MediaRecorder

(static) nyquist(coefficientopt) → {Number}

Returns the Nyquist frequency for the current sample rate multiplied by an optional coefficient.

Parameters:
Name Type Attributes Default Description
coefficient Number <optional>
1
Source:
See:
Returns:
Type
Number

(static) start()

Resumes the main AudioContext. Must be called after the first user gesture so playback works in all browsers.

Source:

(static) stop()

Suspends the main AudioContext.

Source:

(static) time(durationopt) → {Number}

Returns the currentTime for the main AudioContext plus an optional duration and lookahead time.

Parameters:
Name Type Attributes Default Description
duration Number <optional>
0
Source:
See:
Returns:
Type
Number

(static) zeroTime() → {Number}

Returns the next appreciable timestamp.

Source:
See:
Returns:
Type
Number