views:

195

answers:

1

Hi,

I have a MediaElement which I set its Source to a new Uri based on a valid String.

For example:

MediaElementName.Source = new Uri("string");

The string is a valid path, and after debugging, sometimes it sets the "MediaElementName"'s NaturalDuration, sometimes it does not..

I have been googling for at least 2 hours now with no working results..

Does anyone on here have an idea of why sometimes it would set the NaturalDuration, and sometimes it would not? I AM able to play the wav, but it has no idea on how long the wav file is (time duration).

Any help or thoughts are appreciated, thanks!!

-BTG

A: 

I actually just took a step back and instead retrieved the information using FileInfo.

FileInfo test = new FileInfo("myFilepath"); double size = test.Length;

-BTG

Kyle