The audio system Java-related code is in the./frameworks/base/Media/Java/Android/Media/directory.
There are mainly the following files:
Audiomanager. Java
Provides an interface for upper-layer applications to manage sound settings.
Audioservice. Java
Audio setting service, which is started in systemserver to provide services for all audio-related settings.
An audiosystemthread class is defined in audioservice to monitor audio control.
When there is a request, it calls the audiosystem interface to implement audio control,
Here message processing is asynchronous. In addition, the audioservice abstracts a set of audio sending control messages.
Good interfaces provide support for audiomanager.
Audiosystem. Java:
It defines the basic types of audio systems and interfaces for basic operations. It corresponds
Frameworks/base/CORE/JNI/android_media_audiosystem.cpp
Ringtone. Java
Ringtonemanager. Java
Provides quick playback and management interfaces for ringtones, alarm alarms, and other reminders.
Audiotrack. Java
Directly provides support for PCM data, corresponding to frameworks/base/CORE/JNI/android_media_audiotrack.cpp
Soundpool. Java
Provides an interface for referencing playback sound and optimizes file loading.
Tonegenerator. Java
Supports playing DTMF tones,
For example, the dialing tone of the phone corresponds to directly providing support for PCM data, corresponding to frameworks/base/CORE/JNI/android_media_tonegenerator.cpp
Audiorecord. Java
This is the external recording interface of the audio system, corresponding to: Frameworks/base/CORE/JNI/android_media_audiorecord.cpp