Re: Loop Audio on iPhone
Re: Loop Audio on iPhone
- Subject: Re: Loop Audio on iPhone
- From: William Stewart <email@hidden>
- Date: Tue, 17 Feb 2009 14:46:07 -0800
On Feb 17, 2009, at 2:31 PM, Marco Papa wrote: Bill,
I did some more research. You say in your post below:
"AudioQueue's buffer routines provide a trimming function for just this purpose. AVAudioPlayer uses these."
I did the same exercise you mentioned below. I obtained a fairly long "uncompressed" WAV file. I played it using the "loop" function of AVAudioPlayer: the loop worked flawlessly.
Then I encoded it with AAC and stored in a CAF file using afconvert, as suggested in your post below.
I verified using afiinfo that the "priming frames" (2112) at the beginning and the "remainder frames" at the end are also stored in the CAF file.
Then I tried to loop the CAF file using AudioQueuebuffer routines (using AudioFileGetProperty((audio_file, kAudioFilePropertyPacketTableInfo,... to get the priming and remainder frames totals ). This seems to also loop fine.
Then I tried to loop the CAF file using AVAudioPlayer routines using the same code that loops fine with the uncompressed WAV file. This one did NOT loop fine and there is a very audible glitch.
I tried both of the above using the iPhone Simulator - 2.2.1 (latest release). I haven't tried it an actual iPhone yet, but I would not expect it to be any different.
Should I submit a bug report?
For sure (and if you can include your code that will be great) - I would have expected this to work. Thanks
Bill
|
_______________________________________________
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