Hi- I was wondering if- using oly JavaScript – there is a way to get the length of a WAV or MP3 file embedded in the page. If anyone can help me out, it would be helpful. Thanks everyone in advance.
@fredmvMar 06.2004 — #If you're trying to build some kind of media player, there is a decent solution you could use: simply store the duration of each song in the array (e.g., [font=courier]["1:45", "3:23"][/font]) then you could easily (via the [font=courier]split[/font] method or otherwise) obtain the lengths of each song and run a function to go to the next song based on the duration of each song. Though, it would of course be easier using some kind of API for the embedded media object, that is if there even is one. And, if there is, you'll need some kind of [font=courier]getMediaLength[/font] method.
@IceMetalPunkauthorMar 06.2004 — #Actually, I am not trying to make a media player. I am trying to embed a RANDOM song using an array of song sources, and then change the length of that song to milliseconds to close the pop-up the song will be embedded in as soon as the song is over. I guess I will have to put the times in the source array and split from there, but how would I convert minutes and seconds to milliseconds using Javascript?