×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Aug 2012
    Posts
    4

    How to get mp3 audio length in wp7??

    I want to get the duration time (length) of the song in wp7 by c#

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,748

    Re: How to get mp3 audio length in wp7??

    Have you tried MediaElement.NaturalDuration? Based on the docs I would assume that it will be available after the MediaOpened event.

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    958

    Re: How to get mp3 audio length in wp7??

    Quote Originally Posted by wizard_hu_ View Post
    Have you tried MediaElement.NaturalDuration? Based on the docs I would assume that it will be available after the MediaOpened event.
    And you are correct. In fact you should not try to get it until you have that event raised. Unfortunally these is no way, afaik, to get the length of a song until its opened. The you can do something like:
    using c#
    double songLength = mySoundObject.NaturalDuration.TimeSpan.Seconds;

    using vb.net
    dim songLength as Double = mySoundObject.NaturalDuration.TimeSpan.Seconds

  4. #4
    Registered User
    Join Date
    May 2012
    Posts
    23

    Re: How to get mp3 audio length in wp7??

    Have you check if mp3 duration is included on TAG information?

Similar Threads

  1. SMS Max Length
    By computerxt in forum Symbian
    Replies: 4
    Last Post: 2010-03-16, 05:50
  2. Replies: 3
    Last Post: 2009-09-16, 16:08
  3. How to calculate audio data's length in seconds
    By eekisa in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-05-14, 02:29
  4. Replies: 0
    Last Post: 1970-01-01, 02:00

Posting Permissions

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