Real-time synthesis vs. files for long background sessions

For a sleep app running 8–12 hours in background, is AVAudioSourceNode with a real-time render block more power-efficient than looping a pre-encoded audio file via AVAudioPlayerNode? I want to migrate from files to procedural synthesis but not at the cost of battery. What does Instruments / Energy Log show as the typical CPU overhead difference, and is there Apple guidance on this trade-off?

Hi @king_D ,

In general, high-quality synthesis will be more CPU-intensive than playing audio files (although this depends heavily on the audio codec used for playback). I recommend prototyping your synthesis engine and using the Instruments Time Profiler to compare the two approaches and identify which is best for you or where you can optimize the synthesis. The Accelerate framework can also help here.

Real-time synthesis vs. files for long background sessions
 
 
Q