473,386 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

MCI C# tracks length

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.

Jun 5 '07 #1
1 5469
DllImport("winmm.dll")
private static extern long mciSendString(string strCommand,
StringBuilder strReturn, int iReturnLength, IntPtr hwndCallback);
string sCommand = "............."; //see
http://msdn.microsoft.com/library/de...nd_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:
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.
Jun 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Paul | last post by:
Hi, (First apologies if this is not the most relevant place to post this but I wasn't sure of where was and I am writing my app in VB.) I'm attempting to parse a binary file for which I have...
5
by: Mitchua | last post by:
Simplified a bit, I'm parsing HTML documents to get sentences e.g. my $html = get($URL); # remove all HTML TAGs...blah blah blah @sentences = split(/\./, $html)); then I'm trying to determine the...
2
by: MatthewRoberts | last post by:
Howdy All, I have a Windows Service that often stops in its tracks with no exception and no explanation on our QA system. During testing on the development machine, it can handle any workload,...
14
by: Luiz Antonio Gomes Pican?o | last post by:
How i can store a variable length data in file ? I want to do it using pure C, without existing databases. I'm thinking to use pages to store data. Anyone has idea for the file format ? I...
4
by: randomtalk | last post by:
hello, I'm doing an exercise in "The C Programming Language, Second Edition". I just can't get one of the first chapter problem correct (I do realize however that there are answer exist on the...
0
by: masterjuan | last post by:
Networks Hacking (hack C:/ drives, severs...)and security holes all on my website & hacking commands and I explain ways of erasing your tracks so you dont get caught doing "bad" things... What do...
1
by: Sathyaish | last post by:
I have the following scenario: Algorithm: 3DES Cipher Mode: CBC Key Size: 128-bit Block Size: 64 bit IV: 0x0000000000000000 (an eight byte array of zeros) The results I get using .NET with...
22
by: semedao | last post by:
Hi , I am using asyc sockets p2p connection between 2 clients. when I debug step by step the both sides , i'ts work ok. when I run it , in somepoint (same location in the code) when I want to...
14
by: Richard Maher | last post by:
Hi, Can anyone please show me a regular expression (or function or other) for padding out a string to a fixed number of bytes? At the moment I've got a var initialized to N spaces, where 'N'...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.