Options
Menu

Interface Options

Options passed to AudioInputTest constructor.

Hierarchy

  • Options

Index

Properties

Optional Private audioContextFactory

audioContextFactory: typeof AudioContext

AudioContext mock to be used during the test.

Optional Private audioRecorderFactory

audioRecorderFactory: typeof AudioRecorder

AudioRecorder mock to be used during the test.

Optional Private debug

debug: undefined | false | true

Whether or not to log debug statements to the console.

Optional deviceId

deviceId: MediaTrackConstraintSet["deviceId"]

The device ID to try to get a MediaStream from using getUserMedia.

Optional duration

duration: undefined | number

Duration of time to run the test in ms.

default

Infinity

Optional enableRecording

enableRecording: undefined | false | true

Whether the test should record the audio input or not. If set to true, AudioInputTest.Report.recordingUrl will be available for audio playback. Your application should revoke this URL if it is no longer needed.

Example:

const audioInputTest: AudioInputTest = testAudioInputDevice({ enableRecording: true });
audioInputTest.on(AudioInputTest.Events.End, (report: AudioInputTest.Report) => {
  const audioEl = new Audio();
  audioEl.src = report.recordingUrl;
  audioEl.play();

  // Revoke the url if no longer needed
  URL.revokeObjectURL(report.recordingUrl);
});
default

false

Optional Private enumerateDevices

enumerateDevices: typeof enumerateDevices

Used to mock the call to enumerateDevices.

Optional Private getUserMedia

getUserMedia: typeof getUserMedia

Used to mock calls to getUserMedia.

Optional volumeEventIntervalMs

volumeEventIntervalMs: undefined | number

The interval between emissions of volume events in milliseconds.

default

100

Generated using TypeDoc