Skip to content

Commit 0b9ab9d

Browse files
authored
Update readme.md
1 parent f2ac269 commit 0b9ab9d

1 file changed

Lines changed: 10 additions & 15 deletions

File tree

readme.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# audio-buffer [![test](https://github.com/audiojs/audio-buffer/actions/workflows/node.js.yml/badge.svg)](https://github.com/audiojs/audio-buffer/actions/workflows/node.js.yml) [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](http://github.com/badges/stability-badges)
22

3-
Audio data container with planar float32 layout.
3+
> Audio data container with planar float32 layout.
44
5-
[Web Audio API AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)-spec ponyfill, a drop-in replacement for _Buffer_ in node, bun and other envs for audio processing.
5+
A drop-in replacement for _Buffer_ in node, bun and other envs for audio processing.<br>
6+
[Web Audio API AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer) spec ponyfill.
67

7-
Comes with optional utils toolkit:
8-
9-
* `audio-buffer` — the `AudioBuffer` class
10-
* `audio-buffer/util` — sample operations
11-
* `audio-buffer/play` — playback helper
8+
Comes with optional utils.
129

1310
```js
1411
import AudioBuffer from 'audio-buffer'
@@ -18,18 +15,16 @@ let buf = from([0, 0, 0.5, 0.8, 0.3, 0, 0])
1815
buf = normalize(trim(buf))
1916
```
2017

21-
## Constructor
18+
## API
19+
20+
### Constructor
2221

2322
```js
2423
new AudioBuffer({ length: 1024, sampleRate: 44100, numberOfChannels: 2 })
2524
new AudioBuffer(2, 1024, 44100) // positional form
2625
```
2726

28-
* `length` — samples per channel (>= 1)
29-
* `sampleRate` — 3000..768000
30-
* `numberOfChannels` — default 1
31-
32-
## Properties
27+
### Properties
3328

3429
All read-only.
3530

@@ -40,7 +35,7 @@ All read-only.
4035

4136
Iterable over channels: `for (let ch of buf)`, `let [L, R] = buf`.
4237

43-
## Methods
38+
### Methods
4439

4540
```js
4641
buf.getChannelData(0) // → Float32Array view of channel
@@ -51,7 +46,7 @@ buf.concat(other) // → new buffer (same shape requ
5146
buf.set(other, offset?) // write other into this at offset
5247
```
5348
54-
## Static
49+
### Static
5550
5651
```js
5752
AudioBuffer.fromArray([left, right], 44100) // from Float32Array[] per channel

0 commit comments

Comments
 (0)