musix-streamer
An easy way to stream audio
Support
You can contact us on our Discord server
Usage
Play a readable stream
const Streamer = require("musix-streamer");
const ytdl = require("ytdl-core");
const Speaker = require("speaker");
const streamer = new Streamer();
const speaker = new Speaker({
channels: 2,
bitDepth: 16,
sampleRate: 44100
});
console.log("start playback");
streamer.stream(ytdl("https://www.youtube.com/watch?v=hyj4JFSErrw")).pipe(speaker);
API
Streamer(options?: constructorOptions)
stream(options: streamOptions) returns
streamOptions
- List of options can be found here.
Options
All options are optional!
constructorOptions
{
opus: boolean,
volume: boolean,
output: outputType
}
streamOptions
{
seek: number,
volume: number,
ffmpegArgs: array
}
outputType
Ffmpeg: Will output an instance of FFmpeg.
readable: Will output an instance of nodeJS readable.
opus: Will output an instance of opus encoder. (useful for Discord bots)
Copyright (c) 2020 MatteZ02