Re: Newbie: trying to log samples
Re: Newbie: trying to log samples
- Subject: Re: Newbie: trying to log samples
- From: kelly jacklin <email@hidden>
- Date: Thu, 3 Feb 2005 10:47:05 -0800
On Feb 3, 2005, at 10:24 AM, Michael Hanna wrote:
Or if I printout the first 256 samples, I get 64 significant numbers and the rest zeroes. Why are there missing samples and why this 4:1 ratio of significant data to none?
The problem is because of:
<x-tad-smaller>#define SOUND_PRINTOUT_SIZE (2 * 128)</x-tad-smaller><x-tad-smaller>
</x-tad-smaller>
and:
<x-tad-smaller> memcpy (aSample, buffer->mData, SOUND_PRINTOUT_SIZE); </x-tad-smaller><x-tad-smaller>// grab 128 frames, 256 words</x-tad-smaller><x-tad-smaller>
</x-tad-smaller>
Your memcpy is only copying SOUND_PRINTOUT_SIZE _bytes_, whereas you seem to be expecting the buffer to contain SOUND_PRINTOUT_SIZE samples of data after the memcpy (since you are looping over the samples for that number of times)...
Does that help?
kelly
_______________________________________________
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