get or calculate mp3 songs time
i am using FC5 and i have installed realplayer
i want to know if i have an mp3 file how can i calculate the time period of that song because i have made a small program to call real player and play a song and i want to the real player to close when the song finishes how can i do that help |
Real player must be showing time for that mp3 song.... or else from the bit rate and thw sze of file you can calculate time of the song....
|
From unit analysis, you have bits/second, and bytes, and want to get seconds, so multiply the bitrate by the number of bits in the file (convert bytes to bits), this leaves you with inverse seconds, (1/s), about useless, so take its inverse to get to seconds over 1, or just plain old seconds.
That said, can you borrow code from one of the players to ask the ID3 tag how long the file is? Does the file itself even know how long it is? Scott |
realplay --quit "Quit when playback is completed"
|
All times are GMT -5. The time now is 04:51 AM. |