Re: AudioFileStreamParseBytes produces no packets
Re: AudioFileStreamParseBytes produces no packets
- Subject: Re: AudioFileStreamParseBytes produces no packets
- From: John Buckley <email@hidden>
- Date: Wed, 30 Mar 2011 10:44:34 +0100
On 28 March 2011 19:08, John Buckley <email@hidden> wrote:
> 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.
FWIW the problem was that my code was sending out-of-order bytes to
AudioFileStreamParseBytes (actually it was repeating the data
section). The mp3 decoder is obviously more robust that the AAC/WAV
decoder and didn't mind too much. All are now working without the need
to set the discontinuous flag.
John
------------------------
Dr. John Buckley
Olive Toast Software Ltd
www.olivetoast.com
------------------------
On 28 March 2011 19:08, John Buckley <email@hidden> wrote:
> 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