...

View Full Version : how big?



ez4ne12c
04-05-2003, 06:24 AM
I know i can determine how big an image is in pixels..
how do i detemine how long a sound file is in seconds?
can this be done for wav au and mp3?
ez

webmarkart
04-05-2003, 06:37 AM
for an image: assuming you're not using an image editor, you can open it in IE and right click on it and click "properties". That will give you the height and width in pixels.

for the sound: you should be able to tell just by playing it in your default media player.

cg9com
04-05-2003, 06:38 AM
depends, how are you trying to accomplish retrieving this information (language)? or was that part of the question? :D :D

short of just looking at your files and seeing it that way, i suppose your dealing with dynamic content ....(?)

ez4ne12c
04-05-2003, 06:59 AM
What i need to do is change an image on the page when the sound stops..
so i would like to no how long the sound file is so that i can just set a timeout..
maybe there is another way but i have checked on the EMBED tag and theres not alot to work with there..
im guessing i cant use an onUnload in the embed..
i need the time of the sound OR an onDonePlayingSound event
any ideas?
ez

ez4ne12c
04-05-2003, 07:01 AM
oh as for language im using IE with activeX controls so i guess i could look at the file size and make a guess.. i was hoping to nail it down a bit better than that.......
ez

webmarkart
04-05-2003, 07:02 AM
you're going to run into problems with that because it will take different computers different lengths of time to load the sound. Why not do it in Flash so you can control the timeline very easily?

ez4ne12c
04-05-2003, 07:06 AM
two word answer is 'my ignorance' ;)
ez

ez4ne12c
04-05-2003, 07:08 AM
Can i somehow make the play of sound an event and the use
event.Unload?
ez

webmarkart
04-05-2003, 07:12 AM
I'll leave that to someone better qualified to answer that as I use Flash for this type of thing... sorry!

ez4ne12c
04-05-2003, 07:18 AM
Thanks webmarkart.. i appreciate your suggestion
ez:)

ez4ne12c
04-07-2003, 02:53 AM
Well i did it in js thanks to MSDN
..
this seems to work..
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML XMLNS:t ="urn:schemas-microsoft-com:time">
<HEAD>
<TITLE>mediaDur Property</TITLE>
<?IMPORT namespace="t" implementation="#default#time2">

<STYLE>
.time{ behavior: url(#default#time2);}
</STYLE>
</HEAD>

<BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF"
LINK="#000000" VLINK="#808080" ALINK="#000000">

<t:audio id="m1" style="position:absolute;top:50px;height:100px"
src="s9.wav" />

<SPAN style="position:absolute;top:165px;" id="mediaDur1">Media duration:</SPAN>

<P style="position:absolute;top:190px;">
<BUTTON id="b1" onclick="mediaDur1.innerText='Media duration: ' +
m1.mediaDur + ' seconds'">Click here for media's duration</BUTTON>
</P>
</BODY>
</HTML>



just if anyone else is ever interested..
ez :)

cg9com
04-07-2003, 03:22 AM
some of that just flew right over my head. :D :D :D

ez4ne12c
04-07-2003, 04:29 AM
Its over my head too .. its a direct (almost) cut and paste from MSDN
It works for other media such as video too check out the source



http://msdn.microsoft.com/workshop/author/behaviors/reference/time_dmusic_entry.asp
ez



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum