JSmith
JSmith

Reputation: 11

How to get the duration length of an mp3 file from a URL

I have a requirement to get the length in seconds from an audio file. All I am given is the URL of the file. I have tried with the NAudio library but when I try using a URL as source I get the error-

The given path's format is not supported

Below is the code-

 Mp3FileReader reader = new Mp3FileReader(RecordingURL);
 Result = reader.TotalTime

Upvotes: 1

Views: 631

Answers (1)

Mark Heath
Mark Heath

Reputation: 49522

Mp3FileReader cannot open files from a URL, but MediaFoundationReader can, so you should try that instead.

Upvotes: 1

Related Questions