• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Examples for AudioFileStream and AudioConverter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Examples for AudioFileStream and AudioConverter?


  • Subject: Re: Examples for AudioFileStream and AudioConverter?
  • From: William Stewart <email@hidden>
  • Date: Thu, 11 Sep 2008 12:32:24 -0700

ok - can you please file a bug report and attach the file - that will be very helpful. http://bugreporter.apple.com

On Sep 11, 2008, at 12:57 AM, Nick Zitzmann wrote:


On Sep 10, 2008, at 6:07 PM, William Stewart wrote:

There is a sample there of using audio file with audio converter - which is not too different than what you are doing below. I think that would help you to sort some of the code out below as it is (at a casual glance) doing more than I think you really need to do


I've already read through it, but this time I tried running it alongside my program using the AudioFileStream API. And I've found that, for some reason, AudioFileStream gets the data format completely wrong. On one such MP3 chunk of data, AudioFileStream says it's a 44KHz stereo MP1 with 384 frames per packet, whereas AudioFile is reporting something more realistic - 11KHz mono MP3 with 576 frames per packet.

QuickTime Player is siding with AudioFile on this.

This coincides with AudioFile reporting a sane size per packet on VBR MP3s (1052 bytes) while the rough AudioFileStream equivalent, AudioConverterGetProperty(), is returning a crazy high maximum packet size (8192 bytes).

That's expected.

With audio file you can make a better estimate of the possible max packet size in a file because you know what's in it. An audio converter has no idea - it hasn't seen the whole bit stream, and even if it had, it would still not give you anything but what it does. What the converter gives you is the max packet size as specified by the format itself, and this is always a "theoretical/defined by the format" value and not an actual value for any given stream of bits.

So unless anyone has any explanations for this strange behavior, it looks like I'm going to have to write the MP3 to disk and use AudioFile to facilitate the conversion, which seems like a crazy workaround, and I'm wondering how I'm going to get streaming to work...

Well, for the moment I would ignore the bit streams that are giving you problems and just get it working with the ones that you know are good. My guess at this point is that there is something non-conformant in the bit stream that is tripping up an edge case in audio file stream that both QT and audio file are not being caught on (or have workarounds for). Because of the different natures and requirements of audio file stream, it does have differences in the parsing code. We try to minimise those so that there is some consistency, but MP3 in particular is a minefield of incompatabilities...


Bill



Nick Zitzmann
<http://seiryu.home.comcast.net/>
S/MIME signature available upon request





_______________________________________________ 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
  • Follow-Ups:
    • Re: Examples for AudioFileStream and AudioConverter?
      • From: Nick Zitzmann <email@hidden>
References: 
 >Examples for AudioFileStream and AudioConverter? (From: Nick Zitzmann <email@hidden>)
 >Re: Examples for AudioFileStream and AudioConverter? (From: james mccartney <email@hidden>)
 >Re: Examples for AudioFileStream and AudioConverter? (From: William Stewart <email@hidden>)
 >Re: Examples for AudioFileStream and AudioConverter? (From: Nick Zitzmann <email@hidden>)
 >Re: Examples for AudioFileStream and AudioConverter? (From: William Stewart <email@hidden>)
 >Re: Examples for AudioFileStream and AudioConverter? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: dev. in leopard, won't run in tiger
  • Next by Date: Re: dev. in leopard, won't run in tiger
  • Previous by thread: Re: Examples for AudioFileStream and AudioConverter?
  • Next by thread: Re: Examples for AudioFileStream and AudioConverter?
  • Index(es):
    • Date
    • Thread