-
- All Implemented Interfaces:
public interface IVoiceAudioManager
This interface is used for handling the audio actions in context of voice service. It exposes the needed methods for a proper running of voice service
-
-
Method Summary
Modifier and Type Method Description abstract Unit
init(Context context)
This method will handle the initialization of the audio manager mechanism abstract Unit
playSound(Integer resId, Function0<Unit> onCompletionAction)
This method handles the play of a specific sound. abstract Unit
handleAudioFocus(VoiceDialogState voiceState)
This method will handle the audio focus based on voice states It will request audio focus when voice flow is started and abandon focus when voice flow is ended. abstract Unit
handleMicrophoneState(VoiceDialogState voiceState)
This method will handle the microphone state based on voice states It will enable the mic when the recording is started and disable it after registration process is ended abstract Unit
handleDefaultAudioNotificationsState(Boolean shouldMute)
Method that handles the mute state of notification sounds. -
-
Method Detail
-
init
abstract Unit init(Context context)
This method will handle the initialization of the audio manager mechanism
- Parameters:
context
- The context used for initializing audio system resources
-
playSound
abstract Unit playSound(Integer resId, Function0<Unit> onCompletionAction)
This method handles the play of a specific sound.
- Parameters:
resId
- The resource ID of the sound that has to be playedonCompletionAction
- the actions which should be executed once the playback of a media source has completed.
-
handleAudioFocus
abstract Unit handleAudioFocus(VoiceDialogState voiceState)
This method will handle the audio focus based on voice states It will request audio focus when voice flow is started and abandon focus when voice flow is ended.
- Parameters:
voiceState
- The state of the voice at a specific moment
-
handleMicrophoneState
abstract Unit handleMicrophoneState(VoiceDialogState voiceState)
This method will handle the microphone state based on voice states It will enable the mic when the recording is started and disable it after registration process is ended
- Parameters:
voiceState
- The state of the voice at a specific moment
-
handleDefaultAudioNotificationsState
abstract Unit handleDefaultAudioNotificationsState(Boolean shouldMute)
Method that handles the mute state of notification sounds. This is needed when the SDK runs on a phone or tablet, because the SpeechRecognizer plays a default "beep" sound when the speech recognizing starts and ends. In order to not hear this default "beep" we need to mute the notifications on the device. The notifications are muted while the user interacts with the voice service and after they are unmuted.
This should be used only when the SDK is used on phone or tablet.
- Parameters:
shouldMute
- if true will set the notifications on the device to mute, if false will unmute the notifications in the device
-
-
-
-