?
Solved

How to determine play length of a MIDI file?

Posted on 1998-04-05
2
Medium Priority
?
349 Views
Last Modified: 2012-06-27
How do I determine the length of a midi file in seconds, milliseconds or whatever is possible? I would like to be able to display the time remaining and update the display using the MCI StatusUpdate event. Any help will be greatly appreciated.
0
Comment
Question by:Foyal
2 Comments
 
LVL 6

Accepted Solution

by:
clifABB earned 300 total points
ID: 1460426
The MCI has a 'Length' property which specifies the length of the file as defined by the 'TimeFormat' property:

MMControl1.Command = "Open" 'Must be open before you can get the length
MMControl1.TimeFormat = mciFormatMilliseconds
Debug.Print MMControl1.Length
0
 
LVL 3

Author Comment

by:Foyal
ID: 1460427
I think this will work. I have tried it and everything seems OK. The problem I had was that I set the .TimeFormat property before opening the file and it won't work that way. Thanks for your help!
Foyal
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question