summaryrefslogtreecommitdiff
path: root/README.md
blob: 38207f1def489adf8a338aa24c840a48cd9197d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
mossrose
========

> *Portulaca grandiflora*

A minimal-dependency PortAudio-based audio mixer library. It doesn't *load* audio; you'll need to do that yourself.


api
---

### `int mr_init(double sample_rate, int n_channels)` ###

Initialize mossrose with `n_channels` worth of audio, at `sample_rate` Hz. Returns 0 on success and 1 otherwise.


### `int mr_terminate()` ###

Terminate mossrose.


### `int mr_play(float *left, float *right, size_t n_samples, int channel)` ###

Play a sound. Either `left` or `right` may be NULL, but not both. If `channel` is non-negative, 
it will use that channel; otherwise, it will use the first available free channel. Returns the 
channel used on success, or -1 on failure.