![]() |
VOOZH | about |
dotnet add package Plugin.Maui.Audio --version 4.0.0
NuGet\Install-Package Plugin.Maui.Audio -Version 4.0.0
<PackageReference Include="Plugin.Maui.Audio" Version="4.0.0" />
<PackageVersion Include="Plugin.Maui.Audio" Version="4.0.0" />Directory.Packages.props
<PackageReference Include="Plugin.Maui.Audio" />Project file
paket add Plugin.Maui.Audio --version 4.0.0
#r "nuget: Plugin.Maui.Audio, 4.0.0"
#:package Plugin.Maui.Audio@4.0.0
#addin nuget:?package=Plugin.Maui.Audio&version=4.0.0Install as a Cake Addin
#tool nuget:?package=Plugin.Maui.Audio&version=4.0.0Install as a Cake Tool
Plugin.Maui.Audio provides the ability to play, record and stream audio inside a .NET MAUI application.
Plugin.Maui.Audio provides the AudioManager class that allows for the creation of and and . The AudioManager can be used with or without dependency injection.
AudioManagerThere are two different ways in which you can interact with the AudioManager implementation provided by this plugin, they are:
You will first need to register the AudioManager with the MauiAppBuilder based on the following example:
builder.AddAudio();
You can also customize the shared settings for audio , and .
You can then enable your classes to depend on IAudioManager as per the following example.
public class AudioPlayerViewModel
{
readonly IAudioManager audioManager;
public AudioPlayerViewModel(IAudioManager audioManager)
{
this.audioManager = audioManager;
}
public async Task PlayAudioAsync()
{
var audioPlayer = audioManager.CreatePlayer(await FileSystem.OpenAppPackageFileAsync("ukelele.mp3"));
audioPlayer.Play();
}
}
Alternatively if you want to skip using the dependency injection approach you can use the AudioManager.Current property.
public class AudioPlayerViewModel
{
public async Task PlayAudioAsync()
{
var audioPlayer = AudioManager.Current.CreatePlayer(await FileSystem.OpenAppPackageFileAsync("ukelele.mp3"));
audioPlayer.Play();
}
}
Now that you know how to use the AudioManager class, please refer to the following sections:
The audio formats supported for playback depend on the underlying platform:
| Platform | Supported Formats |
|---|---|
| Android | MP3, WAV, AAC, FLAC, OGG and other formats supported by Android's MediaPlayer |
| iOS/MacCatalyst | MP3, WAV, AAC, ALAC, AIFF, and other formats supported by AVAudioPlayer |
| Windows | MP3, WAV, AAC, FLAC, WMA, and other formats supported by Windows MediaPlayer |
The audio file format is determined automatically based on the file extension or stream content.
Recording capabilities vary by platform with the following supported encoding formats:
| Platform | Supported Recording Formats |
|---|---|
| Android | WAV (PCM), AAC (Android 12+) - MediaRecorder docs |
| iOS/MacCatalyst | WAV (PCM), ULaw, ALAC (Apple Lossless), FLAC, AAC - AVAudioRecorder docs |
| Windows | WAV (PCM), ALAC (Apple Lossless), FLAC, AAC - Windows.Media.Capture docs |
When recording or streaming PCM audio (WAV format):
This project could not have came to be without these projects and people, thank you! ❤️
Basically this plugin, but then for Xamarin. We have been using this in our Xamarin projects with much joy and ease, so thank you so much Adrian (and contributors!) for that. Find the original project here where we have based our project on and evolved it from there.
As a little sample song we wanted something Hawaii/Maui themed obviously, and we found The Happy Ukelele Song which seems to fit that description. Thank you Stanislav Fomin and AudioHero for making it available.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-android35.0 net9.0-android35.0 is compatible. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-ios18.0 net9.0-ios18.0 is compatible. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 net9.0-maccatalyst18.0 is compatible. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net9.0-windows10.0.19041 net9.0-windows10.0.19041 is compatible. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Plugin.Maui.Audio:
| Package | Downloads |
|---|---|
|
PolyhydraGames.Core.Maui
Package Description |
|
|
FireSoft.Maui.Ui
Librerie per lo sviluppo di App Maui di FireSoft Italia Srl |
|
|
ItEnterprise.Maui.Scanning
ItEnterprise scanning library for MAUI |
|
|
fair.maui
fair maui client |
|
|
fairdao.maui.shared
fair maui client |
Showing the top 3 popular GitHub repositories that depend on Plugin.Maui.Audio:
| Repository | Stars |
|---|---|
|
VladislavAntonyuk/MauiSamples
.NET MAUI Samples
|
|
|
bijington/orbit
The Orbit engine is a game engine built on top of .NET MAUI Graphics. The objective is to firstly enjoy the journey of building a game engine and secondly providing a framework that allows us to utilise the best parts of a cross-platform framework while building a 'typical' game.
|
|
| santacrab2/PKHeXMAUI |
| Version | Downloads | Last Updated |
|---|---|---|
| 5.0.0-preview1 | 428 | 5/12/2026 |
| 4.0.0 | 193,469 | 5/23/2025 |
| 4.0.0-preview2 | 15,002 | 4/9/2025 |
| 4.0.0-preview1 | 435 | 4/4/2025 |
| 3.1.1 | 67,881 | 4/4/2025 |
| 3.1.0 | 15,218 | 3/27/2025 |
| 3.0.1 | 158,850 | 9/10/2024 |
| 3.0.0 | 101,976 | 6/3/2024 |
| 3.0.0-preview3 | 2,074 | 5/6/2024 |
| 3.0.0-preview2 | 8,915 | 11/30/2023 |
| 3.0.0-preview1 | 352 | 11/27/2023 |
| 2.1.0 | 131,437 | 11/27/2023 |
| 2.0.0 | 30,650 | 9/29/2023 |
| 2.0.0-preview2 | 1,503 | 9/11/2023 |
| 2.0.0-preview1 | 735 | 9/4/2023 |
| 1.0.0 | 98,690 | 11/29/2022 |
| 0.1.0-preview2 | 1,695 | 11/3/2022 |
| 0.1.0-preview1 | 2,564 | 8/22/2022 |