Search code examples
androidaudiovoipvoip-android

How to set type to my audio so it will be treated like a call?


I'm making VoIP app on Android, playing PCM audio like in Play PCM stream in Android

On my phone (LG V20, Android8) it works, but when I'm using volume buttons, it doesn't show Call volume and volume control doesn't work for my audio at all.

How to make my audio "Call audio" and be controlled by standard volume controls?


Solution

  • In the end, I was missing:

    1. Permission - MODIFY_AUDIO_SETTINGS
    2. Setting AudioManager mode to MODE_IN_COMMUNICATION

    I'm surprised it wasn't in tutorials, maybe it was changed in later SDK.