User Tag List

Results 1 to 4 of 4

Thread: Finding time in seconds of sample file.

  1. #1
    No Products Registered

    Join Date
    Jun 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Finding time in seconds of sample file.

    I'm playing an .ogg music file as a sample. What I want to do is find its full duration and its current 'position' eg a 4 minute track - and display their value, in a alt val or a counter, etc. Then I need to be able to start a track from a value, for example 1.32, so the 'track' would start from there.

    What is the best way to accomplish this? Also, would looping the sample file change the method in any way?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Finding time in seconds of sample file.

    There is an expression to get the duration of a sample. It returns a value in milliseconds, so you must convert it to minutes/seconds:

    SampleDuration("Ambient Zombies")/1000.0 = Sample Duration in seconds.

    Use the set sample position, and do the opposite calculation (x1000) to choose the right place to start it from.

  3. #3
    No Products Registered

    Join Date
    Jun 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Finding time in seconds of sample file.

    Thanks, this certainly pointed me in the right direction.

    But I do have one 'problem' - the duration of the ogg is different in two places.

    In vlc media player, it is 1 min 13.

    In MMF2, the same file is 75.692 seconds, which is 1.261533333 minutes.

    I've had a bit of a debug attempt, and whether I'm looping or not, changing the channel or sample position, nothing changes. It still shows it as 1.26 minutes. Another track I tried is also a bit longer than it is in the media player. Also, listening at the same time with the MMF2 app and the media player playing, they are perfectly in sync and start and end at the same time.

    I'm just curious really - as I know what the duration MMF2 gives it I can work with that. I'm just wondering where the difference comes from.

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Finding time in seconds of sample file.

    You do know there aren't 100 seconds in a minute? MMF2 is indeed correct. You need to convert that fraction of a minute (those decimals) into seconds.
    Working as fast as I can on Fusion 3

Similar Threads

  1. Finding Y velocity at Time
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 30th April 2013, 10:26 AM
  2. Need a little help with displaying a big total of seconds into a proper time format
    By Shmuper in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 6th April 2012, 12:05 PM
  3. Game Time.. Use Seconds or alterable value?
    By DaveC in forum iOS Export Module Version 2.0
    Replies: 7
    Last Post: 27th February 2012, 03:51 PM
  4. Seconds to Days, Hours, Minutes and seconds
    By dingdong in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 1st April 2007, 07:30 PM

Posting Permissions

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