Reduce Opus CPU load on low-powered Android devices
How to reduce Open CPU load.
Read time 1 minuteLast updated 7 months ago
If you need to reduce the Vivox CPU load for lower-power Android devices, the Vivox SDK exposes the method to set the algorithmic complexity of the codec to another value. The Vivox SDK uses a default complexity value of 9, but you can set this down to 0 to reduce the CPU usage. The lower the value, the more the audio quality is negatively affected. For example, in a speech signal test where the complexity value was decreased to 0, the encoding time decreased to 39% of the default settings (Complexity: 9, Bandwidth: Auto).
vx_opus_set_complexityIt is also possible to use the method to change the audio bandwidth that Opus uses. If you pass the value, this also reduces the CPU usage, but might have a significant negative impact on audio quality. Lowering the audio bandwidth makes the audio signal sound duller by discarding high frequency content.
vx_opus_set_bandwidthvx_opus_bandwidth::opus_bandwidth_nbNote that reducing complexity has more impact on CPU use reduction than changing the audio bandwidth. For example, a speech signal test with a complexity of 0 combined with got the lowest CPU time of 27% of the CPU time of the default settings (Complexity: 9, Bandwidth: Auto).
vx_opus_bandwidth::opus_bandwidth_nbIf either of these methods do not reduce CPU use enough, you can use the Siren14 codec, which takes 14% of the CPU time of Opus at its default settings. To use the Siren14 codec, perform either of the following actions:
- When you initialize the SDK, update to set the
vx_sdk_config_tfield todefault_codecs_mask.VIVOX_VANI_SIREN14 - When you create your connector object, update the request to set
vx_req_connector_create_ttodefault_codec.VIVOX_VANI_SIREN14