mciSendString - length of a track
- From: _nabuchodonozor <kkocemba@xxxxxxxxxxxxxx>
- Date: Fri, 08 Jun 2007 05:13:04 -0700
HI
The mciSendString returns different value of tracks length than
winamp. The value is longer about 20 seconds and I don't know why.
Here is a code:
public void SetTime() // I tried to set time format as it is said in
MSDN help but it dosent work
{
sCommand = "set MediaFile time format hms";
mciSendString(sCommand, null, 0, IntPtr.Zero);
}
public int TrackLength()
{
Open(pathPlay); // here I open file (with whole path)
which length should be checked
//SetTime();
sCommand = "status MediaFile length";
int i = 128;
System.Text.StringBuilder stringBuilder = new
System.Text.StringBuilder(i);
mciSendString(sCommand, stringBuilder, i,
IntPtr.Zero);
return System.Convert.ToInt32(stringBuilder.ToString());
}
The value is returned in ms. Any ideas?? Or maybe I should use
different function to check the length??
Here is the link which help me a lot:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_status_mm.asp
KK
.
- Follow-Ups:
- Re: mciSendString - length of a track
- From: Ignacio Machin \( .NET/ C# MVP \)
- Re: mciSendString - length of a track
- Prev by Date: Re: MSDN help in in pdf/doc format?
- Next by Date: Go ahead. Stop programming. This ensures you from any mistakes.
- Previous by thread: datagridview column order problem...
- Next by thread: Re: mciSendString - length of a track
- Index(es):
Relevant Pages
|