• 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: Important Audio Formtas [Was: CFBundleDocumentTypes with audio that QT can play]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Important Audio Formtas [Was: CFBundleDocumentTypes with audio that QT can play]


  • Subject: Re: Important Audio Formtas [Was: CFBundleDocumentTypes with audio that QT can play]
  • From: Herbie Robinson <email@hidden>
  • Date: Wed, 20 Apr 2005 02:41:30 -0400

Here is what I am using. I got the list by dumping all the stuff returned by AudioFileGetGlobalInfo and movieUnfilteredFileTypes (in NSMovie).

Maybe I should put it differently:

Which commonly used audio formats can't I ignore, really? (and can be opened by Quicktime)?
1. aiff
2. mp3
3. m4a
4. wav
5. ..?

I've been using the AudioFile interface to read all of the file types that map into kAudioFormatLinearPCM and Quicktime for the compressed formats. I haven't actually measured it, but the the AudioFile interface appears faster (for reading). Quicktime MooV files can have pretty much all of the other formats embedded in them as well (those have to be read via Quicktime).


I used AudioFileReadPackets when using the AudioFile interface and GetMediaSample for Quicktime reading. In both cases, I used the AudioConverter to convert the data into a common format.

The Quicktime API will probably handle all the file types as long as they are listed in the info.plist file. It certainly handled .mp3 files (not encapsulated in a MooV) with no extra work on my part.

The only two significant gotchas I can remember are:

1. AudioConverter doesn't seem to like to return non-interleaved multi-track PCM data (or at least no 16 bit big endian). Not a big deal if you plan for it.

2. Core audio and Quicktime audio don't have the same definition of what a frame and a packet are. What Quicktime calls a frame, core audio calls a packet (but only for compressed data). I used the following code to copy QT audio sample info into a Core audio AudioStreamBasicDescription.

if (mbx->mbDataFormat.mFormatID == kAudioFormatLinearPCM)
{
mbx->mbDataFormat.mFramesPerPacket = 1;
mbx->mbDataFormat.mBytesPerFrame =
mbx->mbDataFormat.mBytesPerPacket = (**sdh).bytesPerFrame;
}
else
{
mbx->mbDataFormat.mBytesPerPacket = (**sdh).bytesPerFrame;
mbx->mbDataFormat.mFramesPerPacket = (**sdh).bytesPerFrame / (**sdh).bytesPerPacket;
mbx->mbDataFormat.mBytesPerFrame = (**sdh).bytesPerPacket;
}


This works for PCM and MP3 data. I haven't tried it with any other compressed data.

Hi all,

I am using Kurt Revis' nice PlayBufferedAudioFile example (from http://www.snoize.com ) to have QT load the audio and Coreaudio playing it, and now I am looking to fill my Application's Info.plist with all CFBundleDocumentTypes that it can play. I opened up the package of QuickTimePlayer but found almost 60 different document types. I think that's a bit too much. QuickTime can also open things like flash or images, see.

So I was wondering if somebody has a Info.plist (or just the array for the key "CFBundleDocumentTypes") laying around that he or she is willing to share, or if you where to get it.
Specifically I like to know only the document types that just contain audio, instead of being a movie with a sound track attached ... my app is not displaying those movies anyway ;-)


Much obliged,
Dirk van Oosterbosch

-- -***************************************** ** http://www.curbside-recording.com/ ** ******************************************

Attachment: %Info.plist
Description: application/applefile

Attachment: Info.plist
Description: Binary data

 _______________________________________________
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: Important Audio Formtas [Was: CFBundleDocumentTypes with audio that QT can play]
      • From: Dirk van Oosterbosch <email@hidden>
References: 
 >CFBundleDocumentTypes with audio that QT can play (From: Dirk van Oosterbosch <email@hidden>)
 >Important Audio Formtas [Was: CFBundleDocumentTypes with audio that QT can play] (From: Dirk van Oosterbosch <email@hidden>)

  • Prev by Date: [OT] Feeder threads
  • Next by Date: NSTask blocks AudioIO
  • Previous by thread: Important Audio Formtas [Was: CFBundleDocumentTypes with audio that QT can play]
  • Next by thread: Re: Important Audio Formtas [Was: CFBundleDocumentTypes with audio that QT can play]
  • Index(es):
    • Date
    • Thread