• 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: newBe Question about buffers...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newBe Question about buffers...


  • Subject: Re: newBe Question about buffers...
  • From: R <email@hidden>
  • Date: Sun, 30 Dec 2012 21:57:44 -0700

Thanks David!

On Dec 30, 2012, at 9:32 PM, David Duncan wrote:

> On Dec 29, 2012, at 10:25 PM, R <email@hidden> wrote:
>
>> Let me ask this a different way…
>>
>> Listed below is the Canonical ASBD for streams between audio units in OSX.
>>
>> How can I have 32 bits per channel and also have 4 bytes per frame/packet?  I would think there would be 8 bytes per frame for 2channel audio.
>
> Since your audio is non-interleaved, the ASBD describes the format of each buffer, not of all the buffers taken together.  Therefore each buffer has 4 bytes per frame, and 1 frame per packet, which is that single Float32.
>
>>
>> mSampleRate	Float64	44100
>> mFormatID	UInt32	1819304813
>> mFormatFlags	UInt32	41
>> mBytesPerPacket	UInt32	4
>> mFramesPerPacket	UInt32	1
>> mBytesPerFrame	UInt32	4
>> mChannelsPerFrame	UInt32	2
>> mBitsPerChannel	UInt32	32
>> mReserved	UInt32	0
>>
>>
>>
>>
>>
>> On Dec 29, 2012, at 7:31 PM, R wrote:
>>
>>>
>>> This question will be basic to most, but it has been bothering me for awhile.  It has to do with buffers and floats.
>>>
>>> I want to size a buffer.
>>>
>>> The ASBD of the stream I'm dealing with is a follows:
>>>
>>> - Linear PCM
>>> - mFormatFlags=41, kAudioFormatFlagIsFloat, IsPacked, IsNoninterleaved
>>> - 2 channels per frame
>>> - 4 bytes per frame
>>>
>>> Since the stream in nonInterleaved, I will need to have a mBuffers[0] and mBuffers[1] in by BufferList struct
>>>
>>> I assume that I have 2 bytes for each channel (4 bytes per frame / 2)
>>>
>>> Here is my question:
>>>
>>> For kAudioFormatFlagIsSignedInteger, I size each buffer for an UInt16 (2 bytes = 16 bits)
>>>
>>> But, for kAudioFormtFlagIsFloat, there is no such thing as a Float16.  I have to size each channel for a Float32 (32 bits of space).
>>>
>>> Here is my question, is the data value for each channel taking up only 16 bits of float data, but I have to size the buffer for Float32 and just assume wasted space?
>>>
>>> Thanks for your help and patience -- Ron
>>>
>>> å
>>>
>>
>>
>> _______________________________________________
>> 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
>
> --
> Reality is what, when you stop believing in it, doesn't go away.
> Failure is not an option. It is a privilege reserved for those who try.
>
> David Duncan
>


 _______________________________________________
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: 
 >newBe Question about buffers... (From: R <email@hidden>)
 >Re: newBe Question about buffers... (From: R <email@hidden>)

  • Prev by Date: Resetting levels after switching away from kAudioUnitSubType_VoiceProcessingIO
  • Next by Date: more ausampler questions....
  • Previous by thread: Re: newBe Question about buffers...
  • Next by thread: Resetting levels after switching away from kAudioUnitSubType_VoiceProcessingIO
  • Index(es):
    • Date
    • Thread