Home Manual Reference Source
import WebAudioRecorder from 'itslanguage/audio/web-audio-recorder.js'
private class | source

WebAudioRecorder

WebAudioRecorder.

Constructor Summary

Public Constructor
public

constructor(source: GainNode, ctx: AudioContext, streamingCallback: Function, packer: WavePacker)

Use 'low level' processing tooling to record audio and get a Wave (audio/wav) encoded recording.

Member Summary

Public Members
public
public

packer: *

public
public
public
Private Members
private

Method Summary

Public Methods
public

Get the recorded audio specifications.

public

Request encoded audio to be returned through callback.

public

Is audio recording in progress.

public

record()

Start recording audio.

public

stop()

Stop recording audio.

Public Constructors

public constructor(source: GainNode, ctx: AudioContext, streamingCallback: Function, packer: WavePacker) source

Use 'low level' processing tooling to record audio and get a Wave (audio/wav) encoded recording.

Currently supported in all modern HTML5/WebAudio browsers.

Params:

NameTypeAttributeDescription
source GainNode

The source to record.

ctx AudioContext

The AudioContext to use.

streamingCallback Function
  • nullable: true

The callback to deliver audio chunks to.

packer WavePacker

Packer to use.

Public Members

public channels: number source

public packer: * source

public recordedSampleRate: * source

public recording: boolean source

public sampleRate: * source

Private Members

private _recorder: * source

Public Methods

public getAudioSpecs(): Object source

Get the recorded audio specifications.

Return:

Object

Containing metadata on the audio format.

public getEncodedAudio(callback: Function) source

Request encoded audio to be returned through callback.

Params:

NameTypeAttributeDescription
callback Function

The callback to use when returning the audio as a blob in Wave format.

public isRecording(): boolean source

Is audio recording in progress.

Return:

boolean

True when recording. False otherwise.

public record() source

Start recording audio.

public stop() source

Stop recording audio.