UsingAVAudioEngineforPlaybackMixingandRecordingAVAEMixerSample
Demonstrates Playback, Recording and Mixing using AVAudioEngine. Shows how to play AVAudioFile and AVAudioPCMBuffer objects from an AVAudioPlayerNode. Uses an AVAudioSequencer and AVAudioUnitSampler to play back MIDI files. Illustrates one-to-many connections with the connect:toConnectionPoints: API. Shows how to attach and connect effect units such as AVAudioUnitReverb and AVAudioUnitDistortion to the engine and apply them to the audio playing back.
Install / Use
/learn @alve0024/UsingAVAudioEngineforPlaybackMixingandRecordingAVAEMixerSampleREADME
Using AVAudioEngine for Playback, Mixing and Recording
This sample uses the AVAudioEngine with two AVAudioPlayerNode and AVAudioPCMBuffer objects along with an AVAudioUnitDelay and AVAudioUnitReverb to playback two loops which can then be mixed, processed and recorded.
AVAudioEngine contains a group of connected AVAudioNodes ("nodes"), each of which performs an audio signal generation, processing, or input/output task.
For more information refer to AVAudioEngine in Practice WWDC 2014: https://developer.apple.com/videos/wwdc/2014/#502
Requirements
Build
iOS 10 SDK, Xcode Version 8 or greater
Runtime
iOS 10.x
Version History
1.0 First public version
1.1 Minor updates:
- added audio to the UIBackgroundModes in the plist
- improved handling of audio interruptions
- changed the audio category to Playback, previous version used PlayAndRecord, but doesn't require audio input
- fixed a bug in handleMediaServicesReset: method
- corrected some old comments
2.0 Major update:
- (new) Demonstrates use of AVAudioSequencer, AVAudioMixing, AVAudioDestinationMixing
- (new) Added support for iPhone, iPad using Size Classes
- (modified) Useage of a single AVAudioPlayerNode that toggles between a recorded AVAudioFile and a AVAudioPCMBuffer
2.1 Minor update:
- (modified) Explicitly use the buffer format as the connection format for the player to reverb & reverb to mainMixer, to make it clear that these formats must match.
Copyright (C) 2015-2017 Apple Inc. All rights reserved.
Related Skills
node-connect
353.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
Languages
Security Score
Audited on Mar 22, 2026
