Home Reference Source
public class | source

LamejsEngine

Extends:

ComponentRecordEngine → LamejsEngine

Audio-only engine for the lamejs library.

Constructor Summary

Public Constructor
public

constructor(player: Player, options: Object)

Creates an instance of this class.

Member Summary

Public Members
public
public
public

Mime-type for audio output.

public

Path to worker-realtime.js worker script.

public

Specifies the bitrate in kbps.

public

config: {"debug": *, "sampleRate": *, "bitRate": *}

public

Enables console logging for debugging purposes.

public

engine: *

public
public
public
public

Specifies the sample rate to encode at.

Method Summary

Public Methods
public

setup(stream: LocalMediaStream, mediaType: Object, debug: Boolean)

Setup recording engine.

public

start()

Start recording.

public

stop()

Stop recording.

Private Methods
private

Continuous encoding of audio data.

private

Received a message from the worker.

Inherited Summary

From class RecordEngine
public
public

addFileInfo(fileObj: Blob | File)

Add filename and timestamp to recorded file object.

public

Destroy engine.

public

saveAs(name: Object): void

Show save as dialog in browser so the user can store the recorded media locally.

private

Remove any temporary data and references to streams.

private

onStopRecording(data: blob)

Invoked when recording is stopped and resulting stream is available.

Public Constructors

public constructor(player: Player, options: Object) source

Creates an instance of this class.

Override:

RecordEngine#constructor

Params:

NameTypeAttributeDescription
player Player

The Player that this class should be attached to.

options Object
  • optional

The key/value store of player options.

Public Members

public audioContext: * source

public audioSourceNode: * source

public audioType: string source

Mime-type for audio output.

public audioWorkerURL: string source

Path to worker-realtime.js worker script.

public bitRate: number source

Specifies the bitrate in kbps.

public config: {"debug": *, "sampleRate": *, "bitRate": *} source

public debug: boolean source

Enables console logging for debugging purposes.

public engine: * source

public inputStream: * source

public mediaType: * source

public processor: * source

public sampleRate: number source

Specifies the sample rate to encode at.

Public Methods

public setup(stream: LocalMediaStream, mediaType: Object, debug: Boolean) source

Setup recording engine.

Params:

NameTypeAttributeDescription
stream LocalMediaStream

Media stream to record.

mediaType Object

Object describing the media type of this engine.

debug Boolean

Indicating whether or not debug messages should be printed in the console.

public start() source

Start recording.

public stop() source

Stop recording.

Private Methods

private onAudioProcess(ev: Object) source

Continuous encoding of audio data.

Params:

NameTypeAttributeDescription
ev Object

onaudioprocess responded with data object.

private onWorkerMessage(ev: Object) source

Received a message from the worker.

Params:

NameTypeAttributeDescription
ev Object

Worker responded with event object.