AudioFileStreamParseBytes produces no packets
AudioFileStreamParseBytes produces no packets
- Subject: AudioFileStreamParseBytes produces no packets
- From: John Buckley <email@hidden>
- Date: Mon, 28 Mar 2011 19:08:21 +0100
Hi,
I'm writing AudioToolbox code for iOS to handle streamed audio data
using AudioQueue and AudioFileStream. My code works fine when I stream
mp3 files (CBR and VBR). However with m4a (AAC) and wav formats
AudioFileStream is processing the headers correctly, but then never
generates any audio packets.
What happens is I receive data from the network (in this case via
NSURLConnection) and pass this data to AudioFileStreamParseBytes.
Usually (though not always) this data is much larger than the header
and also the packet size. AudioFileStreamParseBytes processes the
header correctly producing appropriate properties, finishing with
kAudioFileStreamProperty_ReadyToProducePackets. But then it never
produces any packets. Feeding more data to AudioFileStreamParseBytes
doesn't produce an error, but equally there are no packets produced.
I've tried various different things, including setting the
kAudioFileStreamParseFlag_Discontinuity flag when calling
AudioFileStreamParseBytes, but to no avail.
One thing to note is that for mp3 streams, after receiving
kAudioFileStreamProperty_ReadyToProducePackets, I have to set
kAudioFileStreamParseFlag_Discontinuity otherwise no packets are
produced for mp3. Setting the flag fixes this, but this doesn't help
for AAC/WAV streams.
Any suggestions would be appreciated.
Thanks,
John
------------------------
Dr. John Buckley
Olive Toast Software Ltd
www.olivetoast.com
------------------------
_______________________________________________
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