Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.72 KB

README.md

File metadata and controls

50 lines (34 loc) · 1.72 KB

Zebble.Audio

logo

A Zebble plugin to play or record audio files.

NuGet

This plugin enables you to record voice and save it to the device and play it in Android, UWP and iOS.


Setup


Api Usage

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:
//Play audio from device
Device.Audio.Play("MyFile.mp3");
//Play audio from URL
Device.Audio.Play("http://example.com/music/music.mp3");
Record Audio:
Device.Audio.StartRecording();
byte[] audiodata = await Device.Audio.StopRecording();

Methods

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