SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

How Do You Prevent Custom Ringback Tone Audio Ducking When Using DefaultAudioDevice?

Question

When using the Twilio Voice iOS SDK with DefaultAudioDevice, why is my custom ringback tone ducked (significantly reduced in volume) during outbound call setup, and how can I prevent this behavior?

During outbound call setup, playing a custom ringback tone via AVAudioPlayer on the shared AVAudioSession results in quiet audio. This occurs because DefaultAudioDevice configures the session with .voiceChat mode, enabling Voice-Processing I/O which triggers iOS "other audio" ducking. Is there a way to configure voiceProcessingOtherAudioDuckingConfiguration or avoid audio ducking when using DefaultAudioDevice?

 

Product

Programmable Voice

 

Answer

To resolve this issue and maintain full volume during the ringing phase, replace DefaultAudioDevice with a custom AudioDevice implementation. Creating a custom audio device gives your application full control over the Audio Unit configuration, allowing you to explicitly modify properties like voiceProcessingOtherAudioDuckingConfiguration or adjust audio unit settings during call setup.

 

Additional Information 

You can reference or clone Twilio's open-source ExampleAudioDevice implementation on GitHub to use as a starting point for building a custom audio device.

Have more questions? Submit a request
Powered by Zendesk