Skip to content

Commit

Permalink
README.md: update
Browse files Browse the repository at this point in the history
  • Loading branch information
asabil committed Dec 10, 2019
1 parent 0d57cd0 commit 96d59c8
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
# alsa

Erlang alsa (libasound2) bindings
Erlang Alsa (libasound2) bindings.

## Build
The Alsa application allows for capture and playing audio through the Linux Alsa
interface.

$ rebar3 compile
# Setup

## Example
You need to add `alsa` as a dependency to your project. If you are using `rebar3`,
you can add the following to your `rebar.config`:

$ rebar3 shell
```erlang
{deps, [
{alsa, "0.1.0"}
]}.
```

Then type the following into the shell:
Also ensure that `alsa` is added as a dependency to your application, by updating
your `.app.src` file:

```erlang
alsa_test:play("default", alsa_test:generate_noise(5000)).
```
```erlang
{application, my_app, [

You should hear random audio coming from the default soundcard.
{applications, [
kernel,
stdlib,

alsa % <- You need this in your applications list
]}
]}.
```

# Usage

For usage please refer to the examples in the examples directory. You can also
test the examples directly from the shell:

```erlang
1> c("examples/alsa_example_pcm.erl").
{ok,alsa_example_pcm}
2> alsa_example_pcm:play("default", alsa_example_pcm:generate_noise(5000)).
ok
```

0 comments on commit 96d59c8

Please sign in to comment.