Smart Platform Audio Management
Understand how SPAM optimizes audio configurations.
Read time 1 minuteLast updated 20 hours ago
The Vivox SDK uses Smart Platform Audio Management (SPAM) to automatically select the optimal Android audio configuration based on the context.
SPAM will optimize the audio configuration for voice if both of the following scenarios occur:
- The client attempts to access the microphone (for example, when in a session)
- The audio is rendered through the built-in speakerphone, or Bluetooth SCO
-
The Android AudioManager mode
- When optimizing for voice, this is set to .
MODE_IN_COMMUNICATION - When optimizing for general-purpose audio, this is set to .
MODE_NORMAL
- When optimizing for voice, this is set to
-
The OpenSL ES render stream and recording preset
- In voice mode, the render stream is set to and the recording preset is set to
SL_ANDROID_STREAM_VOICE.SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION - For general-purpose audio, the render stream is set to and the recording preset is set to
SL_ANDROID_STREAM_MEDIA.SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION
- In voice mode, the render stream is set to
-
The Bluetooth profile
- In voice mode, when using an audio Bluetooth device, SPAM will use Bluetooth SCO by default, if available. This ensures that the microphone on the Bluetooth device is used to provide the best voice experience for Vivox users.
- When leaving voice mode, SPAM will automatically switch to A2DP and prioritize render audio quality over voice experience. This is configurable; you can change SPAM to always use A2DP by setting the parameter on the SDK config struct.
bluetooth_profile
- When you initialize the Vivox SDK, configure the parameter.
dynamic_voice_processing_switching - After the you initialize the Vivox SDK, call .
vx_set_dynamic_voice_processing_switching_enabled()