• 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
adapting "Playing Audio"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

adapting "Playing Audio"


  • Subject: adapting "Playing Audio"
  • From: Roland Silver <email@hidden>
  • Date: Mon, 14 Jan 2008 08:12:29 -0700

I hope I'm not violating the CoreAudio list rules with this email. In a previous post I asked several questions, most of which were answered. The following question was not addressed, so I'm repeating it in hopes of getting an answer

I'm trying to adapt the example given in Chapter 3, "Playing Audio", of the "Audio Queue Services Programming Guide" to my purpose: I generate the audio data algorithmically rather than getting it from a file as in the example. I think that Linear PCM format, with a frame consisting of two floats, one for each channel (left & right stereo), will do for my purposes.

That leaves me guessing as to the proper format of the AudioStreamBasicDescription struct. Here's what I have so far:

typedef struct AudioStreamBasicDescription {
Float64 mSampleRate; //44100
UInt32 mFormatID; //kAudioFormatLinearPCM
UInt32 mFormatFlags; //kLinearPCMFormatFlagIsFloat + kLinearPCMFormatFlagIsBigEndian ?
UInt32 mBytesPerPacket; //Linear PCM doesn't use packets; what do I put here?
UInt32 mFramesPerPacket; //Linear PCM doesn't use packets; what do I put here?
UInt32 mBytesPerFrame; //2 * sizeof(float) ?
UInt32 mChannelsPerFrame; //2 ?
UInt32 mBitsPerChannel; //8 * sizeof(float) ?
UInt32 mReserved; //0 ?
} AudioStreamBasicDescription;


Please let me know if I have it right so far, and how to fill in the fields I don't understand.

Roland Silver
email@hidden

_______________________________________________
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: adapting "Playing Audio"
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: linear PCM
  • Next by Date: Re: SMPTE parsing algorithm?
  • Previous by thread: Re: adapting "Playing Audio"
  • Next by thread: Re: adapting "Playing Audio"
  • Index(es):
    • Date
    • Thread