Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2004
    Posts
    86

    Unanswered: Advanced - Fetch duration of wave file

    Hi,

    Im not sure if this is possible but a wish list

    I want a text box where i would enter a filename (always a wave file)
    another textbox would then get the duration of the wave file (somehow)
    and store it in the text box

    is this possible at all, if so how?

    thank you

  2. #2
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    some arithmatic on the filesize can do the job

  3. #3
    Join Date
    Oct 2004
    Posts
    86
    ok , thanks

    do you know what this may be? or any open examples of where it has been done before?

    thank you

  4. #4
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    no i don´t, but if are able to get the filesize, and if you know how long it takes to play you can figure out the dividing by. How ever and that is what i think, each file has an fixed length of header(which is related to standard settings, and file contenance), so a wav file of lets say 1 Mb takes 2 minutes and a wav file of 2 Mb takes 6 minutes , i think the header is about a 0.5 Mb. So you must first deduct this form the filse size and then divide. It just a way of try and error.

  5. #5
    Join Date
    Oct 2004
    Posts
    86
    ok, another question relating to this is how to i get the media player control to open a specified file

    ive tried MediaPlayer1.Open cbobox.text
    but this does not work

  6. #6
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    i can´t help you with this item.

  7. #7
    Join Date
    Dec 2003
    Posts
    268

    Try Creating an object

    You may be able to bastardize the CreateObject method

    dim o as object
    set o = createobject("Media Player")

    you will have to find the methods to open a file etc. from here.

    I'll look around and see if I can find anything, but this should get you headed in the right direction.

    MW

  8. #8
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    you may also get there with Shell

    dim strShell as string
    strShell = "C:\PATH\PATH\WHATEVER.EXE " & cbobox
    ' or cbobox.column(n) depending where the .WAV is in the combo
    Call Shell(strShell)

    izy
    currently using SS 2008R2

  9. #9
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    I tried this, the player opens but don´t know what to do with extension, and next to that it cann´t find the path althoug the path and filename are correct :

    Shell "C:\Program Files\Windows Media Player\WMPLAYER.EXE " & _
    Me!MuzArc.Column(1) & Me!MuzBst.Column(1)

    Me!MuzArc.Column(1) helds the pathname ie. C:\Music\
    Me!MuzBst.Column(1) helds the filename with extension ie. SongName.WMA

    any help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •