• 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
Basic question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Basic question
      • From: Laurent Cerveau <email@hidden>
  • Prev by Date: setting microphone gain
  • Next by Date: Re: Basic question
  • Previous by thread: Re: setting microphone gain
  • Next by thread: Re: Basic question
  • Index(es):
    • Date
    • Thread