Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

musix-streamer

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

musix-streamer

An easy way to stream audio

  • 0.0.9
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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, // whether to output an opus stream (skipping ffmpeg and improving performance) Defaults to `false`
    volume: boolean, // whether to have the ability to alter volume. Defaults to `true`
    output: outputType // what to output when streaming. Defaults to `readable`
}

streamOptions

{
  seek: number, // how far to seek in the stream when starting playback.
  volume: number, // initial volume when starting playback. Defaults to `1`
  ffmpegArgs: array // Custom FFmpeg arguments to pass.
}

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

FAQs

Package last updated on 04 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc