LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   get or calculate mp3 songs time (https://www.linuxquestions.org/questions/linux-software-2/get-or-calculate-mp3-songs-time-507338/)

unabia 12-04-2006 06:34 AM

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

vkmgeek 12-04-2006 06:47 AM

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....

scm86 12-04-2006 06:36 PM

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

unSpawn 12-04-2006 07:29 PM

realplay --quit "Quit when playback is completed"


All times are GMT -5. The time now is 04:51 AM.