Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jpitcairn

macrumors member
Original poster
Aug 11, 2009
74
1
I have created an app that calculated audio file sizes. The formula for this calculation is size = sample rate * number of channels * (bits per sample /8) * time in seconds.

So i have implented this formula using

Code:
int bSize = [channelNumber.text intValue] * [bitDepth.text intValue] / 8 * 
	[sampleRate.text intValue] * [trackLength.text intValue];

This forumla works for the most part but sometimes can give a negative answer. Any ideas why this is happening?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.