Skip to content

Instantly share code, notes, and snippets.

@AngelMunoz
Last active June 6, 2020 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AngelMunoz/149487755f2c348cb6b38306c2917269 to your computer and use it in GitHub Desktop.
Save AngelMunoz/149487755f2c348cb6b38306c2917269 to your computer and use it in GitHub Desktop.
Inspects the music properties of .mp3 files in the music directory
#r "nuget: Microsoft.Windows.Sdk.NET, 10.0.18362.3-preview"
open System
open Windows.Storage
let asyncGetFiles() =
async {
let! files = KnownFolders.MusicLibrary.GetFilesAsync().AsTask() |> Async.AwaitTask
return files |> Seq.take 5
}
async {
let! files = asyncGetFiles()
for file in files do
let! musicProps = file.Properties.GetMusicPropertiesAsync().AsTask() |> Async.AwaitTask
printfn "%s - %s" musicProps.Title musicProps.Album
} |> Async.RunSynchronously
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment