Playing Local Audio Files with .NET MAUI
David Britch’s cross-platform audio control could only pick local files on Windows — until he discovered the file picking issue wasn’t a MAUI bug but a FilePickerFileType misconfiguration. This post explains the fix.
What you’ll learn
- Why picking failed — passing file extensions where iOS and Android expect different formats
- Platform-specific file types — MIME types (with wildcards like
audio/*) on Android,UTType/uniform type identifiers likepublic.audioon iOS and Mac Catalyst, and extensions on Windows - Supporting older iOS — using system-declared uniform type identifiers instead of iOS 14+
UTTypeconstants - Loading the picked file — small
MauiAudioPlayerupdates so every platform plays local audio
Read the full post for the corrected PickOptions code and links to the resulting PR and repo.