adapting "Playing Audio"
adapting "Playing Audio"
- Subject: adapting "Playing Audio"
- From: Roland Silver <email@hidden>
- Date: Sun, 13 Jan 2008 14:49:44 -0700
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.
I have a question about "clipping level". Since the LinearPCM signals are in float format they have an enormous range. Is there a maximum signal value above which the audio output will be clipped?
Roland Silver
|
_______________________________________________
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