Skip to main content
November 28, 2009
Answered

deterining duration of a sound file.

  • November 28, 2009
  • 1 reply
  • 467 views

This is a two part question:

1. Is there a method of determining the length of a sound file (mp3 primarily);

   in bytes, elapsed time, before the file is played? (the file could be played against

   a stop watch and the elapsed time record after the fact, programmatically).

2. Is it possible to set markers and fast forward/rewind to markers corresponding

   to the file?

What I am thinking of is a feature allowing the user to play a file to a point and pause, set a marker, rewind

and play to the marker and stop, or fast forward from the beginning and play from the marker, or even play

past the marker and rewind to the marker.

Setting a marker would be the easy part: just record the elapsed time when the pause function is called.

Getting the sound file to start playing from that point without the previous part played at normal speed;

(with volume off) is the essential part of this question.

Thank you

JK

This topic has been closed for replies.
Correct answer kglad

you're welcome.

please mark this thread as answered, if you are still able.

1 reply

kglad
Community Expert
Community Expert
November 28, 2009

1.  use the length property of the sound class

2.  yes, the play() method of the sound class accepts a starttime parameter.

November 28, 2009

Thank you;

That solves some things.

JK

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
November 28, 2009

you're welcome.

please mark this thread as answered, if you are still able.