adapting "Playing Audio"
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