N
_nabuchodonozor
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
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