[haiku-development] Re: Calculate time in minutes

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Mon, 3 Dec 2012 17:57:26 -0500

On Mon, Dec 3, 2012 at 2:20 PM, Giovanni Mugnai <musical777@xxxxxxxxx> wrote:
> 2012/12/3 Marcus Overhagen <marcus.overhagen@xxxxxxxxx>:
>> Audio CD is 44.1 kHz, 16 bit, stereo. for every second.
>>
>> 1 minute = 44100 * 2 * 2 * 60 bytes
>>
>> regards
>> Marcus
>
> Hi Marcus,
> to be more complete i am working on a function that tells you time of
> audioCD, for improvements on BurnItNow:

It is hard to tell what is going on from the code samples you linked
to but I'm guessing that the total_audio variable represents the total
audio cd time and then that eventually gets stuffed into the
fAudioInfo.total_time member variable.

The code (int)(fAudioInfo.total_time / 1000000) / 60 gets you minutes
(microseconds / 100000 gets you seconds / 60 gets you minutes) and the
code (int)(fAudioInfo.total_time / 1000000) % 60) gets you seconds
(microseconds /100000 gets you seconds % 60 rounds to the nearest
second I guess), So, fAudioInfo.total_time must be a value in
microseconds, perhaps this is not the case? Also I don't understand
the mod 60 part of the seconds calculation but perhaps somebody can
clue me in there.

Other related posts: