Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zserge committed Nov 26, 2020
1 parent 57da333 commit 7a82379
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# beep

Beep is a minimal cross-platform sound playback library. All it does is beeping at the given frequency for the given duration of time.

* Good old C89 code with globals.
* Very small, ~100 lines of code for all platforms.
* Easy to use, API is a single blocking function.
* Uses ALSA on Linux, CoreAudio on macOS and Beep() WINAPI function on Windows.

The API is the following:

```c
int beep(int frequency, int duration);
```
Frequency is in Hz, duration is in milliseconds. To convert note index into a frequency use the following formula: `440 * pow(2, ((note - 49) / 12))`.
There is a also a `beep` utility which shows how the API can be used.
If you found an issue or would like to propose a feature - PRs are welcome as long as they are small and simple!
Code is distributed under MIT license, feel free to use in commercial projects.

0 comments on commit 7a82379

Please sign in to comment.