An Audio Context is a set of secondary, platform-specific aspects of audio
playback, typically related to how the act of playing audio interacts with
other features of the device. AudioContext is containing platform specific
configurations: AudioContextAndroid and AudioContextIOS.
This class contains flags to control several secondary, platform-specific
aspects of audio playback, like how this audio interact with other audios,
how is it played by the device and what happens when the app is
However, note that each platform has its nuances on how to configure audio.
This class is a generic abstraction of some parameters that can be useful
across the board.
Its flags are simple abstractions that are then translated to an
AudioContext containing platform specific configurations:
AudioContextAndroid and AudioContextIOS.
If these simplified flags cannot fully reflect your goals, you must create
an AudioContext configuring each platform separately.
The audio mode encompasses audio routing AND the behavior of the telephony
layer. Therefore this flag should only be used by applications that
replace the platform-wide management of audio settings or the main telephony
application. In particular, the inCall mode should only be used by the
telephony application when it places a phone call, as it will cause signals
from the radio layer to feed the platform mixer.
"what" you are playing. The content type expresses the general category of
the content. This information is optional. But in case it is known (for
instance movie for a movie streaming service or music for a music
playback application) this information might be used by the audio framework
to selectively configure some audio post-processing blocks.
"why" you are playing a sound, what is this sound used for. This is achieved
with the "usage" information. Examples of usage are media and alarm.
These two examples are the closest to stream types, but more detailed use
cases are available. Usage information is more expressive than a stream
type, and allows certain platforms or routing policies to use this
information for more refined volume or routing decisions. Usage is the most
important information to supply in AudioContextAndroid and it is
recommended to build any instance with this information supplied.