| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
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
| References: | |
| >Newbie: trying to log samples (From: Michael Hanna <email@hidden>) | |
| >Re: Newbie: trying to log samples (From: Michael Thornburgh <email@hidden>) | |
| >Re: Newbie: trying to log samples (From: Michael Hanna <email@hidden>) | |
| >Re: Newbie: trying to log samples (From: kelly jacklin <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.