Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: trying to log samples



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:
http://lists.apple.com/mailman/options/coreaudio-api/email@hidden

This email sent to email@hidden
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>)



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.