audio-gain
Gain node for PCM audio stream
Last updated 3 years ago by dfcreative .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install audio-gain 
SYNC missed versions from official npm registry.

Audio-gain is a transform stream to change the volume of audio data. It includes audio-gain module with class itself, an <audio-gain> custom element to use in a browser, and a gain command to use in a terminal.

Usage

npm install audio-gain

Module:

var Gain = require('audio-gain');
var Speaker = require('audio-speaker');
var Generator = require('audio-generator');

var generator = Generator({ duration: 2 });
var gain = Gain(0.2);
var speaker = Speaker();

setTimeout(function () {
	gain.setVolume(0.5);
}, 1000);

generator.pipe(gain).pipe(speaker);

Custom element:

<script src="./bundled-dependencies.js"></script>
<link rel="import" href="node_modules/audio-speaker">
<link rel="import" href="node_modules/audio-generator">
<link rel="import" href="node_modules/audio-gain">

<audio-generator id="generator" connect="#gain"></audio-generator>
<audio-gain volume="0.3" id="gain" connect="#speaker"></audio-gain>
<audio-speaker id="speaker"></audio-speaker>

Command:

$ cat sample.wav | gain --volume 0.5 | speaker

Related

GainNode — gain node in web-audio-api.
pcm-volume — similar package, volume is taken as tangential.
audio-lab — audio playground, sound graph constructor.

Current Tags

  • 1.1.2                                ...           latest (3 years ago)

6 Versions

  • 1.1.2                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 6
Last Month 10
Dependencies (5)
Dev Dependencies (3)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |