Skip to content

Commit 2c635f4

Browse files
Provide usage instruction in the readme
1 parent d8420c9 commit 2c635f4

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,43 @@
11
# NetCoreAudio
2-
Allows playback of audio files on .NET Core with minimal dependencies
2+
The library allows playback of audio files on .NET Core on any operating system with minimal dependencies
3+
4+
# Usage
5+
6+
The library exposes Player class, which detects the OS the library is running on and abstracts away any OS-specific audio playback implementations.
7+
8+
## Properties
9+
10+
### bool Plaing
11+
12+
Indicates that the audio is currently playing.
13+
14+
### bool Paused
15+
16+
Indicates that the audio playback is currently paused.
17+
18+
## Methods
19+
20+
### Play(string fileName)
21+
22+
Will stop any current playback and will start playing the specified audio file. The fileName parameter can be an absolute path or a path relative to the directory where the library is located. Sets Playing flag to true. Sets Paused flag to false.
23+
24+
### Pause()
25+
26+
Pauses any ongong playback. Sets Paused flag to true. Doesn't modify Playing flag.
27+
28+
### Resume()
29+
30+
Resumes any paused playback. Sets Paused flag to false. Doesn't modify Playing flag.
31+
32+
### Stop()
33+
34+
Stops any current playback and clears the buffer. Sets Playing and Paused flags to false.
35+
36+
Stopped playback cannot be resumed. If the same file needs to be played again, it can only be played from the beginning.
37+
38+
## Events
39+
40+
### EventHandler PlaybackFinished
41+
42+
Internally, sets Playing flag to false. Additional handlers can be attached to it to handle any custom logic.
43+

0 commit comments

Comments
 (0)