https://github.com/jamen/pull-audio-speaker
Output to speaker as a pull-stream sink
https://github.com/jamen/pull-audio-speaker
Last synced: 10 months ago
JSON representation
Output to speaker as a pull-stream sink
- Host: GitHub
- URL: https://github.com/jamen/pull-audio-speaker
- Owner: jamen
- License: mit
- Created: 2017-05-15T01:03:42.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-15T01:09:37.000Z (about 9 years ago)
- Last Synced: 2025-03-28T05:01:51.887Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# pull-audio-speaker
> Output to speaker as a pull-stream sink
```js
pull(
generator(Math.random),
speaker()
)
```
It uses [`audio-speaker`](https://github.com/audiojs/audio-speaker) internally
## Install
```sh
npm install --save pull-audio-speaker
```
```sh
yarn add pull-audio-speaker
```
## Usage
### `speaker(options?, onEnd?)`
Returns a [pull-stream sink](https://github.com/pull-stream/pull-stream) that plays audio buffers in speaker.
It takes the same options as [`audio-speaker`](https://github.com/audiojs/audio-speaker)
```js
pull(
oscillator(),
gain(0.6),
speaker(err => {
// done
})
)
```
## Also see
- [`audiojs`](https://github.com/audiojs) for other audio components
- [`pull-stream`](https://github.com/pull-stream/pull-stream) for minimal streams
- [`audio-speaker`](https://github.com/) for the base functional package