MCI C# tracks length

  • Thread starter _nabuchodonozor
  • Start date
N

_nabuchodonozor

Hi,
I use MCI to play mp3 tracks. I wrote very simple player where I put
the path to mp3 files and press the button play. Everything works
excellent but I want to make my player better and know the length of a
track to show current position of the track on the TrackBar. I
imported :
[DllImport("winmm.dll")]
private static extern long mciSendString(string strCommand,
StringBuilder strReturn, int iReturnLength, IntPtr
hwndCallback);

and I use it to play the tracks. How to use this function or other to
do what I want? Please help me.
 
M

Miroslav Stampar [MCSD.NET / Security+]

DllImport("winmm.dll")
private static extern long mciSendString(string strCommand,
StringBuilder strReturn, int iReturnLength, IntPtr hwndCallback);


string sCommand = "............."; //see
http://msdn.microsoft.com/library/d...med/htm/_win32_multimedia_command_strings.asp
for a complete list of commands
StringBuilder sBuffer = new StringBuilder(128);
mciSendString(sCommand, sBuffer, sBuffer.Capacity, IntPtr.Zero);

p.s. just follow the link I've put

HTH :)

_nabuchodonozor je napisao/la:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top