Integrate system audio into your app.
To interact with system audio, use the
AVAudio class to:
Communicate to the system how you intend to use audio in your app.
Activate your app’s audio session.
Request user permission to record audio.
Subscribe and respond to important audio session notifications about events like audio interruptions and route changes.
Perform advanced audio device configuration, such as setting sample rate, I/O buffer duration, and number of channels.