SoundManager

The SoundManager model enables audio stack management. It allows the application to:

Available in the package com.voxeet.sdk.media.audio.SoundManager.

Methods

registerUpdateDevices

registerUpdateDevices(callback: SoundManager.Call<List>): boolean

Registers external listeners to update the MediaDevice platform.

Parameters

NameTypeDescription
callbackSoundManager.Call<List>callback to register

Returns: boolean - informs if the register call has been properly done.


unregisterUpdateDevices

unregisterUpdateDevices(callback: SoundManager.Call<List>): void

Deregisters external listeners to update the MediaDevice platform.

Parameters

NameTypeDescription
callbackSoundManager.Call<List>callback to deregister

enumerateDevices

enumerateDevices(): Promise<List>

Lists audio and media devices connected to the platform.

Returns: @NonNull Promise<List> - the promise to resolve.


connect

connect(@NonNull device: MediaDevice): Promise<Boolean>

Connects the SDK to the specific device.

Parameters

NameTypeDescription
deviceMediaDevicenon null device

Returns: @NonNull Promise<Boolean> - the promise to resolve.


disconnect

disconnect(@NonNull device: MediaDevice): Promise<Boolean>

Disconnects the SDK from a device.

Parameters

NameTypeDescription
deviceMediaDevicenon null device

Returns: @NonNull Promise<Boolean> - the promise to resolve.


getSystemRingtone

getSystemRingtone(): Ringtone

Gets the Ringtone from an Android system.

Returns: @Nullable Ringtone - the Ringtone instance corresponding to the instance of the current system.


isBluetoothHeadsetConnected

isBluetoothHeadsetConnected(): boolean

Checks for a headset that is connected to the device.

Returns: boolean - the connection state.


isWiredHeadsetOn

isWiredHeadsetOn(): boolean

Checks for wired headset connected to the device.

Returns: boolean - the connection state.


isPlatformConnected

isPlatformConnected(@NonNull deviceType: DeviceType, @NonNull state: ConnectionState): boolean

Checks if the specified device type is connected to the native platform.

Parameters

NameTypeDescription
deviceTypeDeviceTypenon null device type
stateConnectionStatenon null connection state to the native platform

Returns: boolean - informs about the state.


resetDefaultSoundType

resetDefaultSoundType(): SoundManager

Resets an internal Sound Type to the default type.

Returns: @NonNull SoundManager - the current instance to chain calls.


enableMedia

enableMedia(): SoundManager

Sets the current mode to Media.

Returns: @NonNull SoundManager - the current instance to chain calls.


setMediaRoute

setMediaRoute(): SoundManager

Changes the Call mode to the standard Media or System mode. We do not recommend using this method during conferences.

Returns: @NonNull SoundManager - the current instance to chain calls.


abandonAudioFocusRequest

abandonAudioFocusRequest(): SoundManager

Releases the AudioFocus. For more information, see android-sdk-audio.

Returns: @NonNull SoundManager - the current instance to chain calls.


requestAudioFocus

requestAudioFocus(): SoundManager

Acquires the AudioFocus. For more information, see android-sdk-audio.

Returns: @NonNull SoundManager - the current instance to chain calls.


checkOutputRoute

checkOutputRoute(): SoundManager

Calculates the output route and sets the internal state accordingly. Use this method each time it must be recalculated.

Returns: @NonNull SoundManager - the current instance to chain calls.


setSound

setSound(@NonNull type: AudioType, @NonNull assetName: String): boolean

Sets the AudioType to the given asset reference in the voice call mode.

Parameters

NameTypeDescription
typeAudioTypenon null AudioType to set in the stream voice call
assetNameStringnon null name of the asset

Returns: boolean - the current instance to chain calls.


setSound

setSound(@NonNull type: AudioType, @NonNull assetName: String, soundMode: int): boolean

Sets the asset reference name for a given soundMode and an AudioType.

Parameters

NameTypeDescription
typeAudioTypenon null AudioType to set in the stream voice call
assetNameStringnon null name of the asset
soundModeintsound mode for the system

Returns: boolean - the current instance to chain calls.


playSoundType

playSoundType(@NonNull type: AudioType): SoundManager

Plays given AudioType in a stream voice call.

Parameters

NameTypeDescription
typeAudioTypenon null AudioType

Returns: @NonNull SoundManager - the current instance to chain calls.


playSoundType

playSoundType(@NonNull type: AudioType, soundMode: int): SoundManager

Plays a given AudioType in a stream voice call for a given sound mode.

Parameters

NameTypeDescription
typeAudioTypenon null AudioType
soundModeintsound mode

Returns: @NonNull SoundManager - the current instance to chain calls.


playSoundTypeForce

playSoundTypeForce(@NonNull type: AudioType): SoundManager

Forces a given AudioType sound to be played in a stream voice call.

Parameters

NameTypeDescription
typeAudioTypenon null AudioType

Returns: @NonNull SoundManager - the current instance to chain calls.


playSoundTypeForce

playSoundTypeForce(@NonNull type: AudioType, soundMode: int): SoundManager

Forces a given AudioType sound to be played in the given sound mode.

Parameters

NameTypeDescription
typeAudioTypenon null AudioType
soundModeintsound mode

Returns: @NonNull SoundManager - the current instance to chain calls.


stopSoundType

stopSoundType(@NonNull audioType: AudioType): SoundManager

Stops playing the specified type of sound for the stream voice call.

Parameters

NameTypeDescription
audioTypeAudioTypenon null AudioType

Returns: @NonNull SoundManager - the current instance to chain calls.


stopSoundType

stopSoundType(@NonNull audioType: AudioType, soundMode: int): SoundManager

Stops playing the specified type of sound in a given mode.

Parameters

NameTypeDescription
audioTypeAudioTypenon null AudioType
soundModeintsound mode

Returns: @NonNull SoundManager - the current instance to chain calls.


stop

stop(soundMode: int): SoundManager

Stops the sound that is played in a given mode.

Parameters

NameTypeDescription
soundModeintsound mode

Returns: @NonNull SoundManager - the current instance to chain calls.


stop

stop(): SoundManager

Stops the sound that is played in a stream voice call mode.

Returns: @NonNull SoundManager - the current instance to chain calls.


enable

enable(): SoundManager

Enables the sound manager and the internal manager.

Returns: @NonNull SoundManager - the current instance to chain calls.


disable

disable(): SoundManager

Disables the sound manager and the internal manager.

Returns: @NonNull SoundManager - the current instance to chain calls.


isIncompatible

isIncompatible(@NonNull device: MediaDevice): boolean

Checks if a device, such as a smart watch, is incompatible with the device management.

Parameters

NameTypeDescription
deviceMediaDevicenon null The specific device.

Returns: boolean - A flag indicating if the device is incompatible with the device management. True indicates that the device is incompatible, false indicates that the device is compatible.


current

current(): Promise<MediaDevice>

Gets the connected media device.

Returns: Promise<MediaDevice> - the promise to resolve.