• 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: 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
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: "B.J. Buchalter" <email@hidden>
  • Prev by Date: Re: SMPTE parsing algorithm?
  • Next by Date: Re: adapting "Playing Audio"
  • Previous by thread: Re: DLSMusicDevice problems in Leopard
  • Next by thread: Re: adapting "Playing Audio"
  • Index(es):
    • Date
    • Thread