The mpg321 wrapper for Node.js
It requires mpg321
.
In ubuntu, you can install mpg321
:
$ sudo apt-get install mpg321
$ npm install mpg321
var
mpg321 = require('mpg321');
var
proc = mpg321()
.loop(0) // infinity loop
.file('./music.mp3')
.exec();
// SIGINT hack
process.on('SIGINT', function (data) {
process.exit();
});
or, use remote api.
var
mpg321 = require('mpg321');
var
file = './music.mp3',
player = mpg321().remote();
// infinity loop
player.play(file);
player.on('end', function () {
console.log('end');
player.play(file);
});
// SIGINT hack
process.on('SIGINT', function () {
process.exit();
});
mpg321 = require('mpg321');
mpg321
is the mpg321 class constructor.
options
is the options passing as arguments to mpg321 command. (default is empty array []
)
files
is the file list passing as arguments to mpg321 command. (default is empty array []
)
mpg321(['-b'], ['./music.mp3'])
add options or files.
mpg321().options('-b').file('./music.mp3')
Please read -o
section of man mpg321
.
Please read -a
section of man mpg321
.
Please read -g
section of man mpg321
.
Please read -k
section of man mpg321
.
Please read -n
section of man mpg321
.
Please read -@
section of man mpg321
.
Please read -w
section of man mpg321
.
Please read -l
section of man mpg321
.
Please read --cdr
section of man mpg321
.
Please read --au
section of man mpg321
.
Please read -z
section of man mpg321
.
Please read -z
section of man mpg321
.
Please read -v
section of man mpg321
.
Please read -s
section of man mpg321
.
Please read -t
section of man mpg321
.
Please read -q
section of man mpg321
.
Please read -3
section of man mpg321
.
Please read -V
section of man mpg321
.
Please read --stereo
section of man mpg321
.
Please read --aggressive
section of man mpg321
.
Please read --help
section of man mpg321
.
Please read --longhelp
section of man mpg321
.
Please read -B
section of man mpg321
.
Please read -S
section of man mpg321
.
Please read -x
section of man mpg321
.
Please read -K
section of man mpg321
.
Call mpg321 command via child_process.execFile
.
If execOptions
is callable, use as callback
.
Call mpg321 command via child_process.spawn
.
Call mpg321 command with '-R' option.
And if fft
is true
, append -F
flag to options.
It returns mpg321.remote
instance.
Please read LOAD
command section of /usr/share/doc/mpg321/README.remote
(debian).
Please read JUMP
command section of /usr/share/doc/mpg321/README.remote
(debian).
Please read GAIN
command section of /usr/share/doc/mpg321/README.remote
(debian).
Please read PAUSE
command section of /usr/share/doc/mpg321/README.remote
(debian).
Please read STOP
command section of /usr/share/doc/mpg321/README.remote
(debian).
Please read QUIT
command section of /usr/share/doc/mpg321/README.remote
(debian).
Please read @P
section of /usr/share/doc/mpg321/README.remote
(debian).
Please read @E
section of /usr/share/doc/mpg321/README.remote
(debian).
Please read @F
section of /usr/share/doc/mpg321/README.remote
(debian).
Please read @I
section of /usr/share/doc/mpg321/README.remote
(debian).
TSUYUSATO Kitsune (GitHub: @MakeNowJust, Twitter: @make_now_just)
Apache-2.0. Please read LICENSE
.
- Fork this repository.
- Checkout your feature branch.
- Commit your change.
- Push and Pull request.
Welcome your pull request 😄