Feeding audio data to a AudioUnit / AUGraph on iOS
Feeding audio data to a AudioUnit / AUGraph on iOS
- Subject: Feeding audio data to a AudioUnit / AUGraph on iOS
- From: patrick machielse <email@hidden>
- Date: Thu, 26 Apr 2012 22:48:32 +0200
I'm porting some AUGraph code from Mac OS to iOS (5).
On Mac OS the 'input' side of the graph receives its data through:
- ExtAudioFile accessed in a read callback in offline contexts (exporting files to disk)
- AUAudioFilePlayer unit (through underlying ExtAudioFile) in online contexts (playback)
On iOS both are available.
However, the application I work on should use files from a device's 'iPod Library' as input. These are accessed through 'MPMediaItem', which do not expose a 'path' property through which it would be possible to set up an ExtAudioFile. Ugh!
At the moment the only solution I can see is to write yet more code and use AVAssetReaderAudioMixOutput -> CMSampleBufferRef in a read callback to get to the audio samples. It seems that there is no direct control over the number of samples returned by the -[AVAssetReaderAudioMixOutput copyNextSampleBuffer] method, so I'll need to add some custom buffering code as well.
- Is using AVAssetReaderAudioMixOutput a valid approach or have I overlooked a simpler solution?
- Is this AVAssetReaderAudioMixOutput usable in both online and offline contexts?
Thanks,
patrick
--
Patrick Machielse
Hieper Software
http://www.hieper.nl
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden