I haven't tried reading user-selected local files, but it should be possible to read the data into the Web Audio API and find out its duration from there.
Jory
me@jory.org
http://studio.jory.org
On May 29, 2013, at 2:07, Srikumar Karaikudi Subramanian <srikumarks@gmail.com> wrote:
> Hi,
>
> I believe what you're looking for is to load the audio file using an <audio> element and
> watch for the HAVE_METADATA readyState. This is an independent HTML5 feature
> and not part of the Web Audio API.
>
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#htmlmediaelement
>
> -Kumar
>
> On 25 May, 2013, at 11:08 PM, Nopmop Siarf <siarfnopmop@hotmail.fr> wrote:
>
>> hi there!
>>
>> I’m a student in a master program called “media design” in Geneva
>>
>> I’m curently working on a collaborative web audio Platform and i’ll probably need some tips, I don’t know who exactly i’m writing to right now, but may I ask you some spectific questions ? :)
>>
>> I try to get the duration of an audio file in javascript before the submission of the file with a form
>> I think i have to exctract meta data from the header, and there is probably something to do with the fileReader thing but I’m a bit stuck!
>>
>> well thanks in advance if someone has an idea, have a nice day guys
>