avfoundation-ref

Provides AVFoundation audio API reference for iOS apps.

1.1k|81|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/CharlesWiltgen/Axiom --skill avfoundation-ref
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: avfoundation-ref
Source: https://github.com/CharlesWiltgen/Axiom/tree/main/.claude-plugin/plugins/axiom/skills/avfoundation-ref
Command: npx skills add https://github.com/CharlesWiltgen/Axiom --skill avfoundation-ref

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

A reference guide for AVFoundation audio APIs, including sessions, engines, inputs, and advanced features.

Core Features & Use Cases

  • AVAudioSession setup and category configurations
  • AVAudioEngine pipeline construction
  • Input pickers and AirPods high-quality recording configurations

Quick Start

Prompt: "Set up a playback session and an AVAudioEngine pipeline to play a file."

Frequently Asked Questions about avfoundation-ref

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure AVAudioSession for playback and recording on iOS?

AVAudioSession categories define audio behavior: use .playback for output-only, .record for input-only, and .playAndRecord for both. Set the category, mode, and options via AVAudioSession.sharedInstance().setCategory(_:mode:options:) to handle interruptions and route changes automatically.

What's the difference between AVAudioSession and AVAudioEngine for iOS audio?

AVAudioSession manages system-level audio routing, interruptions, and categories. AVAudioEngine provides a node-based pipeline for mixing, processing, and scheduling audio files with lower latency, suited for real-time synthesis and complex mixing workflows.

How do I set up AVAudioEngine to play audio files?

Create an AVAudioEngine instance, attach an AVAudioPlayerNode to the engine, connect it to the output node, load an audio file into AVAudioFile, schedule it on the player node, start the engine, and call play() on the node to begin playback.

Can I record high-quality audio on AirPods with AVAudioSession?

Yes. Set AVAudioSession category to .record or .playAndRecord, configure appropriate options, and use input selection to route from AirPods. AVAudioEngine taps and file scheduling enable bit-perfect capture and storage for post-processing.

How do I handle audio route changes and session interruptions in iOS?

Register for AVAudioSession.interruptionNotification and AVAudioSession.routeChangeNotification. Check notification userInfo to determine interruption type and route change reason, then pause/resume playback or reconfigure the audio pipeline accordingly.

What audio input picker options are available for iOS apps?

Use AVAudioSession's preferredInput and setPreferredInput() to select microphone sources. For UI-driven selection, present a route picker view or custom interface to let users choose between built-in mic, AirPods, external interfaces, and Bluetooth devices.