目录

Audio Playback Development

Selecting an Audio Playback Development Mode

The system provides a variety of APIs for you to develop audio playback applications. You can select them based on the audio data formats, audio sources, audio usage scenarios, and even the programming language you use. Selecting a suitable class helps you reduce development workload and your application deliver a better effect.

In addition to the preceding classes, you can also use AVPlayer and SoundPool in Media Kit to implement audio playback.

Development Precautions for Background Playback

If you want the application to continue playing in the background (including the scenario where the screen is off), you must develop the audio playback functionality and choose either accessing AVSession or requesting a continuous task based on your service scenario. The specific rules are as follows:

If an application does not meet the above access standards, playback in the background will be muted and frozen by the system, preventing normal background playback. Playback will only be resumed and unmuted when the application is brought back to the foreground.

For details, see Background Playback.