SkillAgentSearch skills...

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/UsingAVAudioEngineforPlaybackMixingandRecordingAVAEMixerSample
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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

View on GitHub
GitHub Stars14
CategoryDevelopment
Updated18d ago
Forks5

Languages

Objective-C

Security Score

75/100

Audited on Mar 22, 2026

No findings