RE: Converting aac to LPCM on iOS 4
RE: Converting aac to LPCM on iOS 4
- Subject: RE: Converting aac to LPCM on iOS 4
- From: Stéphane Beauchemin <email@hidden>
- Date: Mon, 25 Oct 2010 16:51:05 -0400
- Thread-topic: Converting aac to LPCM on iOS 4
I went ahead and tried to use the Audio Converter Service with the Audio File services. I have been able to decompress aac to LCPM. However, when I try to use hardware decoder I get a 'perm' error from AudioConverterNewSpecific (which I guess is a permission error to use the hardware decoder, where is this documented?)
My example is much more complex that this but when I change kAppleHardwareAudioCodecManufacturer for kAppleSoftwareAudioCodecManufacturer in the following snippet of code it is fine and I am able to decompress audio and read it back.
AudioClassDescription acd =
{
kAudioDecoderComponentType,
kAudioFormatMPEG4AAC,
kAppleHardwareAudioCodecManufacturer
};
AudioConverterRef acr;
err = AudioConverterNewSpecific(&fileASBD, &outputASBD, 1, &acd, &acr);
I am using iOS 4.0 and I have tested this on an ipod touch 2nd gen (armv6) a 3rd gen (armv7). Can I use the hardware decoder using those api?
And again my orginal question: Is it possible to decode compressed audio in a background thread using hardware decoder without stopping the audio in my application? Anyone knows how it could be done?
Thanks for any help with this!
-----Original Message-----
From: coreaudio-api-bounces+sbeauchemin=email@hidden [mailto:coreaudio-api-bounces+sbeauchemin=email@hidden] On Behalf Of Stéphane Beauchemin
Sent: October-19-10 10:50 AM
To: Core Audio Mailing List
Subject: Converting aac to LPCM on iOS 4
Hi Everyone,
I want to decompress ACC files that are bundled in my app on the iphone using hardware decoder and software decoder (when hardware decoder is busy). Basically, I want to access data as LPCM buffer and do my processing and play them. I have been playing with the sample code iPhoneExtAudioFileConvertTest and done some research on what are the available apis to do this, and come with the following list:
1. Extended Audio File Services (not a really good option, I don't want to write to disk)
2. Audio Converter Services (seems to be what I need, but no sample code on how to use it)
3. Audio Queue Services (using offline rendering)
4. Something else???
The Audio Converter Services seems to be the best api for me. However, I have read in the doc the following "Audio converter objects convert between various linear PCM audio formats" it this still true on iOS 4?
When playing with the iPhoneExtAudioFileConvertTest, I realized that converting to AAC stop audio in the background (music from the ipod music player) but not the other formats (I have messed a bit with the AudioSession property to do it). It seems to be because it is using the hardware decoder to do its job, however how can I switch it to use the software decoder instead, so audio don't stop?
Is it possible to decode compressed audio in a background thread using hardware decoder without stopping the audio in my application?
Cheers,
Stephane
_______________________________________________
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
_______________________________________________
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