A Zebble plugin to play or record audio files.
This plugin enables you to record voice and save it to the device and play it in Android, UWP and iOS.
- Available on NuGet: https://www.nuget.org/packages/Zebble.Audio/
- Install in your platform client projects.
- Available for iOS, Android and UWP.
If you have an audio file and you want to play it, you can just call Device.Audio.Play()
and provide the relative path of the file or a stream URL, or If you want to use the microphone to record the user's voice or the surrounding sounds, you can call Media.Audio.StartRecording()
.
//Play audio from device
Device.Audio.Play("MyFile.mp3");
//Play audio from URL
Device.Audio.Play("http://example.com/music/music.mp3");
Device.Audio.StartRecording();
byte[] audiodata = await Device.Audio.StopRecording();
Method | Return Type | Parameters | Android | iOS | Windows |
---|---|---|---|---|---|
Play | Task | source -> string errorAction -> OnError |
x | x | x |
StopPlaying | Task | errorAction -> OnError | x | x | x |
StartRecording | Task | errorAction -> OnError | x | x | x |
StopRecording | Task<byte[]> | - | x | x | x |