Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

id3 current track position information? 1

Status
Not open for further replies.

CylonLove4Life

Technical User
Feb 15, 2005
53
ES
Hello,
Sorry if this is a dumb question but i know verry little about
id3.
I was wondering if someone here knows how to get the currnet position of the mp3 track playing (1:03)?
Is this info contained in the id3 tag? and if not how do people get that info?

Thanks.
 
...and how is this related to VFP (Visual Fox Pro)?
Wrong forum maybe?
 
It is related to VFP, because i am using VFP to write a mp3 player.
and i thought mabey a foxpro developer like myself may have tried something like this before.
 
The current position being played should not be in the ID3 tag, since, if it were, that would mean that the playing software would be constantly writing to the .MP3 file as it is being played. Instead, Playing a file is a read-only process.

What software are you using to actually play the MP3 file? That's where you should be looking to find the current play position.

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Thanks for the reply,
I and playing the mp3 within a form via windows api - mciSendString.

I gues I could get the total length of the track from id3, and then use math to tie in track position based on the file size.
 
Ah, Then you would want to use the MCI_STATUS command with the MCI_STATUS_POSITION flag...
The dwReturn member is set to the current position.,

It's documented here:

(Here's the main reference page for all MCI stuff... note that MCI is not supported on 64-bit windows...
- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Thanks wgcs,
This is currently what I an doing, the only negative here it that does not return in hr:min:sec format, but instead in milliseconds.
 
Just divide... 1000ms = 1 sec

INT( Ms / (1000 * 60 * 60) ) = hrs
Ms - (1000 * 60 * 60 * hrs ) = remainder
( equivalent to MOD(ms,1000*60*60) )

INT( remainder / ( 1000 * 60 ) ) = mins
mins - ( 1000 * 60 * mins ) = remainder
( equivalent to MOD(remainder,1000*60) )

INT( remainder / 1000 ) = Seconds

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Thanks wgcs,
I came back here to say that I ended up just dividing it by 1000 but you beat me to it.
I guess im a little slow today, I should have thought of that right off.
But again thanks for the reply, your reference links were very helpfull.

Thanks!
 
Hello, again
I thought i might ask this question to see if any had any ideas.
First off, I was sucessful in playing mp3's and getting current track position ect (using mci commands).
However my problem is now this... when I run my program in winodws xp everything works great but when i run it on a slightly older computer with windows 98, it is extreamly picky about which files it will and will not play, and its not even consistant on top of that!
So is there anything I can do here to update the mci drivers on the windows 98 machine?
Or am I looking in the wrong place?
Thanks for your feedback!
 
I don't really have any idea what to look for to solve this problem... you probably want to start a new thread with an appropriate title so that you'll get more help from people browsing the threads (you can refer to this thread simply by number like thread184-1036883 )

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top