Re: Data Types for Extracting samples from Audio Buffer
Re: Data Types for Extracting samples from Audio Buffer
- Subject: Re: Data Types for Extracting samples from Audio Buffer
- From: Graham Cox <email@hidden>
- Date: Tue, 7 Oct 2008 01:15:52 +1100
On 7 Oct 2008, at 12:34 am, Graham Cox wrote:
2008-10-06 09:08:03.109 Roboplasm[33253:813] format flags = 41
[]
2008-10-06 09:08:03.111 Roboplasm[33253:813] bits/channel = 32
format flags = 41 = 0x29 = 0b101001
flags:
enum
{
kAudioFormatFlagIsFloat = (1L << 0), //
<------ 1
kAudioFormatFlagIsBigEndian = (1L << 1), //
<------ 0
kAudioFormatFlagIsSignedInteger = (1L << 2), //
<------ 0
kAudioFormatFlagIsPacked = (1L << 3), //
<------ 1
kAudioFormatFlagIsAlignedHigh = (1L << 4), //
<------ 0
kAudioFormatFlagIsNonInterleaved = (1L << 5), //
<------ 1
kAudioFormatFlagIsNonMixable = (1L << 6),
kAudioFormatFlagsAreAllClear = (1L << 31)
};
Thus we have:
kAudioFormatFlagIsFloat | kAudioFormatFlagIsPacked |
kAudioFormatFlagIsNonInterleaved;
so you have 32 bit float values for each sample. Divide the byte count
by 4 and use [NSNumber numberWithFloat:], and use a float* pointer type.
Note - the docs also state that this is the default format you get
from the audio extraction API.
hth,
Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden