Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
documented public members
  • Loading branch information
adrianstevens authored Feb 20, 2017
1 parent a261f56 commit 3b60cb9
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@

# Xamarin-Plugins
Cross-platform Plugins for Xamarin and Xamarin.Forms

## SimpleAudioPlayer
SimpleAudioPlayer plays audio data as a stream. This allows you to store audio data in a portable class library and play it on all supported platforms.

### Public Properties

**Duration**: length of audio in seconds

**CurrentPosition**: current playpack position in seconds

**Volume**: volume of audio between 0 and 1

**Balance**: balance between left and right as as double, -1 is left only, 0 is both, +1 is right only

**IsPlaying**: is the audio currently playing

**CanSeek**: can the playback position be updated

### Public Methods

**Load(Stream audioStream)**: load a compatible (wav, mp3, etc) audio from a stream

**Load(string fileName)**: load a compatible audio file stored in the executing platform project

**Play()**: play the currently loaded audio

**Stop()**: stop playback and reset current position to start (0)

**Pause()**: pause playback (use Play() to resume)

**Seek(double position)**: seek to a specific location in the audio (in seconds)


### Example
Coded in the shared PCL using the Xamarin.Forms dependancy service
with **mysound.wav** stored in the PCL as an **Embedded Resource**
Expand All @@ -21,5 +49,5 @@ var player2 = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.CreateSimpleAudioP
...
```

Or see it used in a sample app:
For more examples see the **Samples** folder or check out
https://github.com/adrianstevens/Xamarin-Forms/tree/master/DrumPad2

0 comments on commit 3b60cb9

Please sign in to comment.