• 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
Getting AudioFormatGetProperty to fillout a AudioStreamBasicDescription
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting AudioFormatGetProperty to fillout a AudioStreamBasicDescription


  • Subject: Getting AudioFormatGetProperty to fillout a AudioStreamBasicDescription
  • From: Heath Raftery <email@hidden>
  • Date: Fri, 4 Jul 2008 21:03:20 +1000

Way back in May of 2005 I first asked about using AudioFormatGetProperty to populate an AudioStreamBasicDescription based on the kAudioFormatQUALCOMM format.

http://lists.apple.com/archives/coreaudio-api/2005/May/msg00168.html

With some help from the list I was able to get by. Recently I've noticed the solutions implemented way back then no longer work!

In particular, the following code came out of the previous discussion:

<CODE>
  AudioStreamBasicDescription asbdOut;
  UInt32 theSize;

memset(&asbdOut, 0, sizeof(asbdOut));
asbdOut.mFormatID = kAudioFormatQUALCOMM;
asbdOut.mSampleRate = 8000; // kAudioFormatProperty_AvailableEncodeSampleRates says 8000 only
asbdOut.mChannelsPerFrame = 1;


  theSize = sizeof(asbdOut);
  theStatus = AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
                                     0,
                                     NULL,
                                     &theSize,
                                     &asbdOut);
</code>

Previously, this code was enough to fill out the rest of the asbd. Now, nothing happens (which was the original problem before adding the mChannelsPerFrame assignment). If I explicitly set asbdOut.mBytesPerPacket = 35 before the call, all is rosy. But I'm only able to specify this number because I know that is what it returned in the past!

Has something changed in the way this function works? Is QUALCOMM going away? Is the behaviour going to change again? Will specifying 35 bytes per packet explicitly suffice?

Chasing this inconsistent API around doesn't fill me with confidence.

Regards,
Heath

--
 ____________________________________________________________________
|   Heath Raftery    <email@hidden>                         |
|   HRSoftWorks      <http://www.hrsoftworks.net>                    |
|                                                                    |
|   *He who joyfully marches to music in rank and file has already   |
|    earned my contempt. He has been given a large brain by mistake, |
|    since for him the spinal cord would suffice.*                   |
|                    - Albert Einstein                 _\|/_         |
|_____________________________________________________m(. .)m________|

_______________________________________________
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


  • Prev by Date: How to identify mic in speaker?
  • Next by Date: Re: A simple 'Device Through' app (need some help).
  • Previous by thread: Re: How to identify mic in speaker?
  • Next by thread: Re: A simple 'Device Through' app (need some help).
  • Index(es):
    • Date
    • Thread