How To Get the Total Playing Time of an Audio CDLast reviewed: June 21, 1995Article ID: Q112766 |
The information in this article applies to:
- Standard and Professional Editions of Microsoft Visual Basic for Windows, version 3.0
SUMMARYThe MultiMedia Application Programming Interface (API) and the MCI Control have built-in methods that retrieve the total playing time of a CD. The Length property of the MCI Control will retrieve total playing time of the current media.
MORE INFORMATIONAfter setting the MCI Control's TimeFormat property to MCI_FORMAT_TMSF(10) and summing the values returned by the DateAdd function to add the total time values for minutes and seconds together, you can calculate a CD's total playing time. DateAdd starts adding from 12:00:00 AM, so you need to check to see if the total time is less than one hour. If it is, strip off the first three characters (12:) and the AM. If the time is greater than one hour, strip off the AM so that the return value looks like this: 1:09:43
Step-by-Step Example
REFERENCESFor more information, see the Multimedia Programmer's Reference, CDAudio
|
Additional reference words: 3.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |