DEV Community

ArshTechPro
ArshTechPro

Posted on

WWDC 2025 - iOS 26 - Enhance your app’s audio recording capabilities

Spatial description

iOS 26 introduces significant audio capabilities that transform how apps handle input device selection, high-quality recording, and spatial audio processing. These enhancements provide unprecedented control over audio workflows for content creators and developers alike.

Input Route Selection: Native Device Management

Key Features

  • In-app device switching without navigating to System Settings
  • Live sound level metering for connected devices
  • Microphone mode selection view for supported device modes
  • Persistent device selection across app sessions

Implementation Approach

import AVKit

class AppViewController: UIViewController {
    // Configure AudioSession before using input picker
    private let inputPickerInteraction = AVInputPickerInteraction()

    @IBOutlet weak var selectMicButton: UIButton!

    override func viewDidLoad() {
        super.viewDidLoad()

        // Set delegate after configuring audio session
        inputPickerInteraction.delegate = self

        // Add interaction to button
        selectMicButton.addInteraction(inputPickerInteraction)
    }

    @IBAction func handleSelectMicButton(_ sender: UIButton) {
        inputPickerInteraction.present()
    }
}

extension AppViewController: AVInputPickerInteractionDelegate {
    // Implement delegate methods as needed
}
Enter fullscreen mode Exit fullscreen mode

Technical Benefits

  • Seamless user experience with native UI components
  • Real-time audio monitoring during device selection
  • Automatic device persistence between app launches

AirPods High-Quality Recording: Professional Audio Capture

Enhanced Capabilities

  • High sample rate Bluetooth option for audio capture apps
  • Content creator media tuning balancing voice and background sounds
  • LAV microphone-quality performance through optimized Bluetooth link
  • Built-in stem controls for recording start/stop functionality

Configuration Options

// AVAudioSession implementation
AVAudioSessionCategoryOptions.bluetoothHighQualityRecording

// AVCaptureSession implementation  
session.configuresApplicationAudioSessionForBluetoothHighQualityRecording = true
Enter fullscreen mode Exit fullscreen mode

Implementation Strategy

  • Minimal code changes required for existing audio apps
  • Automatic fallback to BluetoothHFP when high-quality unavailable
  • System-level integration with audio input menu

Spatial Audio Capture: Immersive Recording Technology

Technical Foundation

  • Microphone array utilization for 3D scene capture
  • Ambisonics transformation using spherical harmonics
  • First Order Ambisonics (FOA) with 4 harmonic components
  • Omni and dipole components in X, Y, Z directions

File Format Structure

  • Dual audio tracks: Stereo (AAC) + Spatial (APAC/PCM)
  • Compatibility layer for non-spatial audio devices
  • Metadata track containing playback tuning parameters
  • QuickTime Audio (.qta) format support for audio-only apps

AVAssetWriter Implementation Requirements

  • Two AudioDataOutput instances: FOA (4-channel) + Stereo (2-channel)
  • Channel layout configuration via spatialAudioChannelLayoutTag
  • Metadata generation using AVCaptureSpatialAudioMetadataSampleGenerator
  • Simultaneous operation with MovieFileOutput for real-time processing

Advanced Integration Features

  • Real-time audio visualization during recording
  • Live effects processing with sample buffer access
  • Cinematic video compatibility for comprehensive media capture

Audio Mix: Intelligent Sound Separation

Core Functionality

  • Foreground/background separation with speech isolation
  • Multiple rendering styles: Cinematic, Studio, In-Frame
  • Six additional modes including isolated speech/ambience stems
  • Real-time balance control with intensity parameters

AVPlayer Integration

import Cinematic

class AudioMixController {
    // Audio Mix parameters for real-time control
    private var intensity: Float = 0.5 // Range: 0.0 to 1.0
    private var style: CNSpatialAudioRenderingStyle = .cinematic

    func applyAudioMix(to playerItem: AVPlayerItem, with asset: AVAsset) async throws {
        // Initialize CNAssetSpatialAudioInfo asynchronously
        let audioInfo = try await CNAssetSpatialAudioInfo(asset: asset)

        // Create AVAudioMix with current parameters
        let audioMix = audioInfo.audioMix(effectIntensity: intensity,
                                         renderingStyle: style)

        // Apply to player item
        playerItem.audioMix = audioMix
    }

    func updateIntensity(_ newIntensity: Float) {
        intensity = max(0.0, min(1.0, newIntensity))
    }

    func updateStyle(_ newStyle: CNSpatialAudioRenderingStyle) {
        style = newStyle
    }
}
Enter fullscreen mode Exit fullscreen mode

AUAudioMix: Advanced Processing Control

Architecture Components

  • 4-channel FOA input processing
  • Speech/ambience separation engine
  • AUSpatialMixer integration for flexible output options
  • Configurable spatialization with multiple channel layouts

Essential Parameters

  • RemixAmount: Controls separation intensity
  • Style: Defines processing characteristics
  • EnableSpatialization: Toggles spatial mixer functionality
  • SpatialMixerOutputType: Headphones/speakers optimization

Metadata Extraction

import Cinematic

func extractSpatialAudioMetadata(from asset: AVAsset) async throws -> Data? {
    // Initialize spatial audio info for the asset
    let audioInfo = try await CNAssetSpatialAudioInfo(asset: asset)

    // Extract remix metadata for AUAudioMix configuration
    guard let metadataData = audioInfo.spatialAudioMixMetadata else {
        throw AudioMixError.noMetadataFound
    }

    return metadataData
}

enum AudioMixError: Error {
    case noMetadataFound
}
Enter fullscreen mode Exit fullscreen mode

Conclusion

iOS 26 audio enhancements provide comprehensive tools for professional audio capture and processing. The integration of native input selection, high-quality AirPods recording, sophisticated spatial audio capture, and intelligent audio mixing can be used by devs.

Top comments (1)

Collapse
 
arshtechpro profile image
ArshTechPro

AirPods High-Quality Recording possible in iOS 26