Options
All
  • Public
  • Public/Protected
  • All
Menu

The AudioDeviceManager class is a managing class to manage the audio devices and test them out.

Hierarchy

  • AudioDeviceEventEmitter
    • AudioDeviceManager

Index

Constructors

Events

  • Occurs when the recording device list updated

    Parameters

    • event: RECORDING_DEVICE_LIST_UPDATED
    • listener: ((devices: MediaDeviceInfo[]) => void)
        • (devices: MediaDeviceInfo[]): void
        • Parameters

          • devices: MediaDeviceInfo[]

          Returns void

    Returns any

  • Occurs when the playback device list updated

    Parameters

    • event: PLAYBACK_DEVICE_LIST_UPDATED
    • listener: ((devices: MediaDeviceInfo[]) => void)
        • (devices: MediaDeviceInfo[]): void
        • Parameters

          • devices: MediaDeviceInfo[]

          Returns void

    Returns any

  • Occurs when the current recording device changed

    Parameters

    • event: RECORDING_DEVICE_CHANGED
    • listener: ((deviceId: string) => void)
        • (deviceId: string): void
        • Parameters

          • deviceId: string

          Returns void

    Returns any

Methods

  • clear(): void
  • Clear away side effect.

    Returns void

  • enumeratePlaybackDevices(skipPermissionCheck?: boolean): Promise<MediaDeviceInfo[]>
  • Enumerates the audio playback devices.

    Parameters

    • skipPermissionCheck: boolean = false

      true | false, default false.

    Returns Promise<MediaDeviceInfo[]>

    The audio playback device list

  • enumerateRecordingDevices(skipPermissionCheck?: boolean): Promise<MediaDeviceInfo[]>
  • Enumerates the audio recording devices.

    Parameters

    • skipPermissionCheck: boolean = false

      true | false, default false.

    Returns Promise<MediaDeviceInfo[]>

    The audio recording device list

  • safeGetDisplayMedia(constraints?: DisplayMediaStreamConstraints): Promise<MediaStream>
  • Parameters

    • constraints: DisplayMediaStreamConstraints = ...

    Returns Promise<MediaStream>

  • safeGetUserMedia(constraints?: MediaStreamConstraints): Promise<MediaStream>
  • Prompts the user for permission to use a media input which produces a MediaStream with tracks containing the requested types of media.

    Parameters

    • constraints: MediaStreamConstraints = ...

    Returns Promise<MediaStream>

  • Sets the current audio recording device by the device id.

    description

    A successful call of setRecordingDevice triggers the {@link DeviceEvent.RECORDING_DEVICE_CHANGED} event notification.

    Parameters

    • deviceId: string

      The unique id of the audio recording device

    Returns Promise<ErrorCodeType>

    0 means success or fails otherwise

  • startPlaybackDeviceTest(audioFilePath: string): Promise<ErrorCodeType>
  • Starts the audio playback device test.

    description

    A successful call of startPlaybackDeviceTest triggers playing an audio file specified by the user. If the user can hear the voice that means the playback device works properly.

    Parameters

    • audioFilePath: string

      The path of the audio file for the audio playback device test

    Returns Promise<ErrorCodeType>

    0 means success or fails otherwise

  • startRecordingDeviceTest(options?: boolean | MediaTrackConstraints): Promise<MediaStream>
  • Starts the audio capturing device test. This method tests whether the audio capturing device works properly.

    Parameters

    • Optional options: boolean | MediaTrackConstraints

    Returns Promise<MediaStream>

    The audio media stream or fails otherwise

  • Stops the audio playback device test.

    Returns ErrorCodeType

    0 means success or fails otherwise

  • Stops the camera test.

    Returns ErrorCodeType

    0 means success or fails otherwise

  • replaceStreamTrack(originStream: MediaStream, targetStream: MediaStream, stopOrigin?: any): void
  • description

    replace stream track

    Parameters

    • originStream: MediaStream
    • targetStream: MediaStream
    • Optional stopOrigin: any

    Returns void