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

Re: adapting "Playing Audio"


  • Subject: Re: adapting "Playing Audio"
  • From: William Stewart <email@hidden>
  • Date: Tue, 22 Jan 2008 18:48:05 -0800

Have a look at CAStreamBasicDescription in the Public Utility directory in the CA examples... To create this you would:

CAStreamBasicDescription desc;
desc.mSampleRate = 44100.;
desc.SetCanonical(2, true);

desc.Print();

Bill

On Jan 14, 2008, at 7:12 AM, Roland Silver wrote:

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

_______________________________________________ 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
References: 
 >adapting "Playing Audio" (From: Roland Silver <email@hidden>)

  • Prev by Date: Re: Really puzzling ExtAudioFileRead crash...
  • Next by Date: Playing "silence" to an AudioQueue (with VBR format)
  • Previous by thread: adapting "Playing Audio"
  • Next by thread: linear PCM
  • Index(es):
    • Date
    • Thread