Is it possible to set the volume of sound in Twilio Programmable Voice for Android?

1.3k Views Asked by At

Is it possible to set the volume of the stream using Twilio Programmable Voice SDK for Android? I have an use case where user needs to play sound from other apps (such as Spotify) and my Twilio client app at the same time.

What I'm trying to achieve is setting the volume of the Twilio call independently so that user can control how loud it is, without affecting the volume of music from the other applications.

1

There are 1 best solutions below

0
On

Twilio developer evangelist here.

Just a suggestion here as I'm not an Android developer. The SDK itself does not give you control over the volume of the call itself. I did see this question in the related sidebar which suggested that the setVolumeControlStream API allows you to control different audio volumes independently.

The suggestion is to use setVolumeControlStream(AudioManager.STREAM_MUSIC) but there is also AudioManager.STREAM_VOICE_CALL. I'm not sure which the SDK uses, so you might need to experiment.