Reading track duration on Android

tkowalczyktkowalczyk PLMember, University ✭✭
edited September 2015 in Xamarin.Android

I am getting some Exception with this code:

public async Task<string> GetTrackDuration(string pathToFile)
    {
        MediaMetadataRetriever reader = new MediaMetadataRetriever();
        await reader.SetDataSourceAsync (global::Android.App.Application.Context, Android.Net.Uri.Parse (pathToFile));

        return reader.ExtractMetadata(MetadataKey.Duration).ToString();
    }`

How should I do this?

Answers

  • adamkempadamkemp USInsider, Developer Group Leader mod

    I moved this to the Android forum since this is clearly an Android question.

Sign In or Register to comment.