1 Replies - 3068 Views - Last Post: 10 February 2014 - 08:58 AM

#1 redmaster   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 20-March 13

[XNA] Song.FromUri doesn't play

Posted 05 February 2014 - 07:08 AM

made a media player app in XNA with C# but i can`t get song duration.

Uri uriStreaming = new Uri("file://C:/a.mp3");
Song song = Song.FromUri("Song Name", uriStreaming);                       
myString = song.Duration.ToString();
SpriteBatch.DrawString(myfont, myString, stringLocation, myColor);

The string drawn shows 0:00:00 in case of any song, and i have toi mention that not every song is playing. One from a downloaded album won't play, while another randomly downloaded song plays well, of course the duration issue is still there.
If the song is loaded via Content.Load() method, everything is right, Every song is playing, but i really need to load songs from file.

Any advice?

Is This A Good Question/Topic? 0
  • +

Replies To: [XNA] Song.FromUri doesn't play

#2 BBeck   User is offline

  • Here to help.
  • member icon

Reputation: 792
  • View blog
  • Posts: 1,886
  • Joined: 24-April 12

Re: [XNA] Song.FromUri doesn't play

Posted 10 February 2014 - 08:58 AM

I answered this, as best I could in your second post. Unfortunately, I'm sure it's not the answer you wanted, but maybe it will help you understand the "why" of the situation.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1