npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

discord-audio-stream

v0.7.3510721

Published

Discord library to make stream any audio easier.

Readme

Discord Audio Stream

npm GitHub package.json version GitHub Repo stars

This module is designed to work with discord.js/voice v0.19. This package doesn't support older versions!

Designed for 24/7 audio playing on discord.
Discord has many unwanted rate limits, especially in the audio area. This package does all the work and ensures that your music never stops playing due to ffmpeg or Discord, with as little effort as possible.

Recommended best Practise:
Create a global Map<GuildId, AudioManager> (Map<KEY, OBJ>) list. When the feature is used on a guild, add a new instance of AudioManager to the Map. When starting the connection or audio, overwrite the respective configuration with the override methods provided. To finally start, use the respective method. For each call and each change, retrieve the AudioManager object from the list and perform your actions. When the feature get stopped, first execute StopConnection and then Dispose to save as much power as possible. Garbage collection does the rest.
For large features: For large systems, it is recommended to queue each start with the packet p-queue, to give ffmpeg enough time..

👋 Support

Please create an issue on github or write fraujulian on discord!

📝 Usage

Installation

Node.js 22.12.0 or newer is required.

npm install discord-audio-stream
yarn add discord-audio-stream
pnpm add discord-audio-stream
bun add discord-audio-stream

Required Dependencies

AudioManager Instance

Constructor

AudioManager(ffmpegMode: string, renewInMs, number, connectionData: VoiceConnectionDataModel, audioData: VoiceAudioDataModel): IDisposable, IAudioManager
  • ffmpegMode: 'Native' or 'Standalone'
  • renewInMs: renewal time, default 1,5h = 5400000ms - optional
  • connectionData: options for voice connection - optional
  • audioData: options for audio player - optional

Example

let audioManager = new AudioManager(
    'Native',
    5400000,
    {
        VoiceChannelId: 0, //voice channel id where to play music
        GuildId: 0, //guild id
        VoiceAdapter: 0, //guild VoiceAdapter
    },
    {
        ResourceType: '', //resource type like link or file
        Resource: '', //auto play link or file name
    },
);

Fields and Methods of AudioManager

Fields

| Name | Type | Security | Description | | --------- | -------- | --------- | ------------------------------------- | | Active | bool | protected | To check if the connection is active. | | Playing | bool | protected | To check if it is playing audio. |

Methods

| Name | Parameters | Return type | Description | | ----------------------------- | ------------------------------------------------------- | ------------- | ---------------------------------------- | | OverrideVoiceConnectionData | connectionData: VoiceConnectionDataModel | void | To override intern connectionData field. | | OverrideVoiceAudioDataModel | audioData: VoiceAudioDataModel | void | To override intern audioData field. | | CreateAndPlay | | Promise void | Join channel and start playing audio. | | CreateConnection | | void | Let it connect to voice channel. | | PlayAudio | | Promise void | To start playing audio. | | PauseAudio | | void | Pause the audio, if it is playing | | ResumeAudio | | void | Resume the audio, if it is paused. | | SetVolume | volume: number (0 - 100 percent) | void | To set the audio volume. | | StopConnection | | Promise void | Method to disconnect the voice channel. | | Dispose | | void | Dispose all data in object. |

📝 Types

📋 Contributors:

~ FrauJulian - Julian Lechner - CODEOWNER

🤝 Enjoy the package?

Give it a star ⭐ on github!