Basic question
Basic question
- Subject: Basic question
- From: Matthew Johnson <email@hidden>
- Date: Wed, 27 Mar 2002 21:35:45 +1100
Hi,
Very simple question I suspect but I can't find the answer anywhere.
Following is my IOProc for recording from my microphone. It works well. The
only thing I am wondering is what is the actual data in the array of floats?
What is its scale?. How do I retrieve the Amplitude and frequency from the
data?
OSStatus recordCallback(
AudioDeviceID device,
const AudioTimeStamp* now,
const AudioBufferList* input_data,
const AudioTimeStamp* input_time,
AudioBufferList* output_data,
const AudioTimeStamp* output_time,
void* client_data
)
{
int num_of_units = 0;
int i = 0;
float* new_data = NULL;
new_data = (float*)(input_data->mBuffers[0].mData);
num_of_units = input_data->mBuffers[0].mDataByteSize /
sizeof(float);
for (i = 0; (i < num_of_units) && (Units_recorded < Max_units); i++)
{
Pcms[Units_recorded] = new_data[i];
Units_recorded += 1;
}
return kAudioHardwareNoError;
}
Matt
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.