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

dartjs

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dartjs - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

dist/smoothVolume/injection.js

22

dist/core/DartVoiceManager.js

@@ -23,2 +23,7 @@ "use strict";

}
/**
* Join a voice channel
* @param channel The voice based channel
* @param options Join config
*/
join(channel, options) {

@@ -33,9 +38,3 @@ return __awaiter(this, void 0, void 0, function* () {

if (this.connections.has(vc.guildId)) {
if (this.connections.get(vc.guildId).channel.id !== vc.id) {
return yield this.updateChannel(this.connections.get(vc.guildId), vc);
}
else {
const connection = this.connections.get(vc.guildId);
return connection;
}
return yield this.updateChannel(this.connections.get(vc.guildId), vc);
}

@@ -49,2 +48,6 @@ else {

}
/**
* Leave a voice channel
* @param channel The voice channel
*/
leave(channel) {

@@ -64,2 +67,7 @@ const vc = this.client.channels.resolve(channel !== null && channel !== void 0 ? channel : "");

}
/**
* Update voice connection
* @param connection The voice connection
* @param channel The new voice channel
*/
updateChannel(connection, channel) {

@@ -66,0 +74,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -17,8 +17,12 @@ "use strict";

class StreamDispatcher extends tiny_typed_emitter_1.TypedEmitter {
constructor(connection) {
constructor(connection, audioPlayerOptions = {}) {
super();
this.connection = connection;
this.audioPlayer = (0, voice_1.createAudioPlayer)();
this.audioPlayerOptions = audioPlayerOptions;
this.audioPlayer = (0, voice_1.createAudioPlayer)(this.audioPlayerOptions || {});
this.audioResource = null;
this.readyLock = false;
this._readyLock = false;
this._ignoreList = new Set();
this._nextTickCallbacks = new Array();
this._immediateCallbacks = new Array();
this.attachEvents();

@@ -36,2 +40,3 @@ this.connection.voice.subscribe(this.audioPlayer);

if (!this.connection.voice.eventNames().includes("stateChange"))
// @ts-expect-error Argument of type '"stateChange"' is not assignable to parameter of type 'VoiceConnectionStatus.Signalling'?
this.connection.voice.on("stateChange", (_, newState) => __awaiter(this, void 0, void 0, function* () {

@@ -63,4 +68,4 @@ var _a;

}
else if (!this.readyLock && (newState.status === voice_1.VoiceConnectionStatus.Connecting || newState.status === voice_1.VoiceConnectionStatus.Signalling)) {
this.readyLock = true;
else if (!this._readyLock && (newState.status === voice_1.VoiceConnectionStatus.Connecting || newState.status === voice_1.VoiceConnectionStatus.Signalling)) {
this._readyLock = true;
try {

@@ -76,3 +81,3 @@ yield (0, voice_1.entersState)(this.connection.voice, voice_1.VoiceConnectionStatus.Ready, 20000);

finally {
this.readyLock = false;
this._readyLock = false;
}

@@ -82,8 +87,19 @@ }

if (!this.audioPlayer.eventNames().includes("stateChange"))
// @ts-expect-error Argument of type '"stateChange"' is not assignable to parameter of type 'AudioPlayerStatus.Idle'?
this.audioPlayer.on("stateChange", (oldState, newState) => {
var _a, _b, _c, _d, _e, _f;
if (newState.status === voice_1.AudioPlayerStatus.Idle && oldState.status !== voice_1.AudioPlayerStatus.Idle) {
this.emit("finish");
this._immediateCall();
const nonce = (_b = (_a = this.audioResource) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.nonce;
if (typeof nonce === "string" && this._ignoreList.has(nonce))
return this._ignoreList.delete(nonce);
this.emit("finish", (_c = this.audioResource) === null || _c === void 0 ? void 0 : _c.metadata);
}
else if (newState.status === voice_1.AudioPlayerStatus.Playing && oldState.status === voice_1.AudioPlayerStatus.Buffering) {
this.emit("start");
this._nextTickCall();
const nonce = (_e = (_d = this.audioResource) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.nonce;
if (this._ignoreList.has(nonce))
return this._ignoreList.delete(nonce);
// emit the event
this.emit("start", (_f = this.audioResource) === null || _f === void 0 ? void 0 : _f.metadata);
}

@@ -100,11 +116,24 @@ });

}
/**
* Stop the player
* @param [force=false] If the playback should be forcefully stopped
*/
end(force = false) {
this.audioPlayer.stop(force);
}
/**
* Stop the player
* @param [force=false] If the playback should be forcefully stopped
*/
stop(force = false) {
this.end(force);
}
/**
* Play stream over voice connection
* @param stream The readable stream or stream source url to play
* @param options Play options
*/
playStream(stream, options) {
var _a;
this.audioResource = (0, voice_1.createAudioResource)(stream, {
var _a, _b, _c;
const audioResource = (0, voice_1.createAudioResource)(stream, {
inputType:

@@ -120,7 +149,35 @@ // eslint-disable-next-line @typescript-eslint/ban-ts-comment

voice_1.StreamType.Arbitrary,
inlineVolume: (_a = options === null || options === void 0 ? void 0 : options.inlineVolume) !== null && _a !== void 0 ? _a : true
inlineVolume: (_a = options === null || options === void 0 ? void 0 : options.inlineVolume) !== null && _a !== void 0 ? _a : true,
silencePaddingFrames: typeof (options === null || options === void 0 ? void 0 : options.silencePaddingFrames) !== "number" ? 5 : options === null || options === void 0 ? void 0 : options.silencePaddingFrames,
metadata: Object.defineProperties({}, {
nonce: {
value: (0, Util_1.randomId)(),
enumerable: true,
writable: false,
configurable: false
},
data: {
value: options === null || options === void 0 ? void 0 : options.metadata,
writable: true,
enumerable: true,
configurable: true
}
})
});
if (typeof (options === null || options === void 0 ? void 0 : options.initialVolume) === "number" && audioResource.volume) {
Reflect.set(audioResource.volume, "volume", options.initialVolume);
}
if (typeof (options === null || options === void 0 ? void 0 : options.volumeSmoothness) === "number" && audioResource.volume && audioResource.volume.hasSmoothness) {
Reflect.set(audioResource.volume, "_smoothing", options.volumeSmoothness || 0);
}
if ((options === null || options === void 0 ? void 0 : options.ignorePrevious) && ((_c = (_b = this.audioResource) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.nonce))
this._ignoreList.add(this.audioResource.metadata.nonce);
this.end(true);
this.audioPlayer.play(this.audioResource);
this.audioResource = audioResource;
this.audioPlayer.play(audioResource);
}
/**
* Set volume
* @param amount The volume amount to set
*/
setVolume(amount) {

@@ -135,2 +192,19 @@ var _a, _b, _c;

}
/**
* Set volume in percentage
* @param amount The volume amount to set
*/
setVolumePercentage(percentage) {
var _a, _b, _c;
const lastVolume = this.volumePercentage;
if (lastVolume === percentage || !((_a = this.audioResource) === null || _a === void 0 ? void 0 : _a.volume))
return false;
(_c = (_b = this.audioResource) === null || _b === void 0 ? void 0 : _b.volume) === null || _c === void 0 ? void 0 : _c.setVolume(percentage / 100);
this.emit("volumeChange", lastVolume / 100, this.volume);
return true;
}
/**
* Set volume in logarithmic value
* @param amount The volume to set
*/
setVolumeLogarithmic(amount) {

@@ -145,2 +219,6 @@ var _a, _b, _c;

}
/**
* Set volume in decibels
* @param amount The volume in decibels
*/
setVolumeDecibels(amount) {

@@ -155,2 +233,5 @@ var _a, _b, _c;

}
/**
* Get current volume amount
*/
get volume() {

@@ -160,2 +241,11 @@ var _a, _b, _c;

}
/**
* Get current volume in percentage
*/
get volumePercentage() {
return this.volume * 100;
}
/**
* Get current volume as decibels
*/
get volumeDecibels() {

@@ -165,2 +255,5 @@ var _a, _b, _c;

}
/**
* Get current volume as logarithmic value
*/
get volumeLogarithmic() {

@@ -170,2 +263,5 @@ var _a, _b, _c;

}
/**
* Check if the volume is editable
*/
get volumeEditable() {

@@ -175,2 +271,29 @@ var _a;

}
/**
* Volume smoothness availability
*/
get volumeSmoothnessEditable() {
var _a;
return !!((_a = this.audioResource.volume) === null || _a === void 0 ? void 0 : _a.hasSmoothness);
}
/**
* Set volume smoothness
* @param smoothness
*/
setVolumeSmoothness(smoothness) {
if (!this.volumeSmoothnessEditable)
return false;
Reflect.set(this.audioResource.volume, "_smoothing", smoothness);
return true;
}
/**
* Get volume smoothness
*/
get volumeSmoothness() {
var _a;
return ((_a = this.audioResource.volume) === null || _a === void 0 ? void 0 : _a.smoothness) || 0;
}
/**
* The actual streamed duration in ms of current audio resource
*/
get streamTime() {

@@ -180,2 +303,5 @@ var _a, _b;

}
/**
* The total streamed duration in ms of the current audio resource, including paused states
*/
get totalStreamTime() {

@@ -185,5 +311,12 @@ var _a, _b;

}
/**
* The paused state
*/
get paused() {
return this.audioPlayer.state.status === voice_1.AudioPlayerStatus.Paused || this.audioPlayer.state.status === voice_1.AudioPlayerStatus.AutoPaused;
}
/**
* Pause the player
* @param silence Send silence frame during paused state
*/
pause(silence = false) {

@@ -193,2 +326,5 @@ var _a;

}
/**
* Resumes the player
*/
resume() {

@@ -198,4 +334,38 @@ var _a;

}
/**
* Callback provided here runs whenever next track is playable
* @param cb The callback function
*/
next(cb) {
if (!cb || typeof cb !== "function")
throw new TypeError("Next tick callback must be a function");
this._nextTickCallbacks.push(cb);
}
/**
* Callback provided here runs whenever next track is playable
* @param cb The callback function
*/
immediate(cb) {
if (!cb || typeof cb !== "function")
throw new TypeError("Next tick callback must be a function");
this._immediateCallbacks.push(cb);
}
_immediateCall() {
if (!this._immediateCallbacks.length)
return;
this._immediateCallbacks.forEach((cb, idx) => {
void this._immediateCallbacks.splice(idx, 1);
cb();
});
}
_nextTickCall() {
if (!this._nextTickCallbacks.length)
return;
this._nextTickCallbacks.forEach((cb, idx) => {
void this._nextTickCallbacks.splice(idx, 1);
cb();
});
}
}
exports.default = StreamDispatcher;
exports.StreamDispatcher = StreamDispatcher;

@@ -32,2 +32,5 @@ "use strict";

}
/**
* The audio player
*/
get audioPlayer() {

@@ -37,2 +40,5 @@ var _a;

}
/**
* Disconnect from this connection
*/
disconnect() {

@@ -48,2 +54,5 @@ try {

}
/**
* Destroy this connection
*/
destroy() {

@@ -60,2 +69,8 @@ try {

}
/**
* Create a voice connection
* @param channel The voice channel
* @param manager The voice manager
* @param options Join config
*/
static createConnection(channel, manager, options) {

@@ -74,2 +89,7 @@ // eslint-disable-next-line no-async-promise-executor

}
/**
* Join a voice channel
* @param channel The voice channel
* @param options The join config
*/
static joinChannel(channel, options) {

@@ -94,5 +114,14 @@ // eslint-disable-next-line no-async-promise-executor

}
/**
* Play readable stream or remote stream source in this connection
* @param stream The stream source
* @param options The play options
*/
play(stream, options) {
if (!this.dispatcher) {
const dispatcher = new StreamDispatcher_1.default(this);
const dispatcher = new StreamDispatcher_1.default(this, (options === null || options === void 0 ? void 0 : options.behaviours)
? {
behaviors: options.behaviours
}
: {});
this.dispatcher = dispatcher;

@@ -103,5 +132,11 @@ }

}
/**
* The voice connection status
*/
get status() {
return this.voice.state.status;
}
/**
* The voice connection latency (udp)
*/
get ping() {

@@ -108,0 +143,0 @@ const latency = this.voice.ping.udp;

@@ -21,2 +21,7 @@ "use strict";

}
/**
* Create receiver stream
* @param user The target user to listen to
* @param options Receiver options
*/
createStream(user, options = {}) {

@@ -23,0 +28,0 @@ var _a;

@@ -5,6 +5,8 @@ /// <reference types="node" />

import * as _discordjs_voice from '@discordjs/voice';
import { StreamType, JoinConfig, AudioResource, VoiceConnection as VoiceConnection$1, VoiceConnectionStatus } from '@discordjs/voice';
import { StreamType, JoinConfig, CreateAudioPlayerOptions, AudioResource, VoiceConnection as VoiceConnection$1, NoSubscriberBehavior, VoiceConnectionStatus } from '@discordjs/voice';
import { TypedEmitter } from 'tiny-typed-emitter';
import { Readable } from 'stream';
import { Readable, TransformOptions, Transform } from 'stream';
declare function injectSmoothVolume(): void;
declare type VoiceChannels = VoiceChannel | StageChannel;

@@ -19,5 +21,11 @@ interface VoiceEvents {

}
interface DispatcherEvents {
start: () => void;
finish: () => void;
interface DispatcherEvents<T = unknown> {
start: (metadata?: {
nonce?: string;
data?: T;
}) => void;
finish: (metadata?: {
nonce?: string;
data?: T;
}) => void;
error: (error: Error) => void;

@@ -31,5 +39,17 @@ debug: (message: string) => void;

}
interface PlayOptions {
interface PlayOptions<T = unknown> {
/** The stream type */
type?: `${StreamType}` | StreamType | "converted" | "unknown";
/** Enable/disable on-the-fly volume controls */
inlineVolume?: boolean;
/** Silence padding frames */
silencePaddingFrames?: number;
/** Initial volume */
initialVolume?: number;
/** Volume smoothness */
volumeSmoothness?: number;
/** Track metadata */
metadata?: T;
/** Ignore previous track event on running `<Dispatcher>.play()` */
ignorePrevious?: boolean;
}

@@ -42,25 +62,120 @@ interface ReceiveStreamOptions {

declare class StreamDispatcher extends TypedEmitter<DispatcherEvents> {
interface ArMetadata<T = unknown> {
nonce: string;
data: T;
}
declare class StreamDispatcher<T = unknown> extends TypedEmitter<DispatcherEvents<T>> {
readonly connection: VoiceConnection;
audioPlayerOptions: CreateAudioPlayerOptions;
audioPlayer: _discordjs_voice.AudioPlayer;
audioResource: AudioResource;
private readyLock;
constructor(connection: VoiceConnection);
audioResource: AudioResource<ArMetadata<T>>;
private _readyLock;
private _ignoreList;
private _nextTickCallbacks;
private _immediateCallbacks;
constructor(connection: VoiceConnection, audioPlayerOptions?: CreateAudioPlayerOptions);
cleanUp(): void;
private attachEvents;
/**
* Stop the player
* @param [force=false] If the playback should be forcefully stopped
*/
end(force?: boolean): void;
/**
* Stop the player
* @param [force=false] If the playback should be forcefully stopped
*/
stop(force?: boolean): void;
playStream(stream: Readable | string, options?: PlayOptions): void;
/**
* Play stream over voice connection
* @param stream The readable stream or stream source url to play
* @param options Play options
*/
playStream(stream: Readable | string, options?: PlayOptions<T>): void;
/**
* Set volume
* @param amount The volume amount to set
*/
setVolume(amount: number): boolean;
/**
* Set volume in percentage
* @param amount The volume amount to set
*/
setVolumePercentage(percentage: number): boolean;
/**
* Set volume in logarithmic value
* @param amount The volume to set
*/
setVolumeLogarithmic(amount: number): boolean;
/**
* Set volume in decibels
* @param amount The volume in decibels
*/
setVolumeDecibels(amount: number): boolean;
/**
* Get current volume amount
*/
get volume(): number;
/**
* Get current volume in percentage
*/
get volumePercentage(): number;
/**
* Get current volume as decibels
*/
get volumeDecibels(): number;
/**
* Get current volume as logarithmic value
*/
get volumeLogarithmic(): number;
/**
* Check if the volume is editable
*/
get volumeEditable(): boolean;
/**
* Volume smoothness availability
*/
get volumeSmoothnessEditable(): boolean;
/**
* Set volume smoothness
* @param smoothness
*/
setVolumeSmoothness(smoothness: number): boolean;
/**
* Get volume smoothness
*/
get volumeSmoothness(): number;
/**
* The actual streamed duration in ms of current audio resource
*/
get streamTime(): number;
/**
* The total streamed duration in ms of the current audio resource, including paused states
*/
get totalStreamTime(): number;
/**
* The paused state
*/
get paused(): boolean;
/**
* Pause the player
* @param silence Send silence frame during paused state
*/
pause(silence?: boolean): void;
/**
* Resumes the player
*/
resume(): void;
/**
* Callback provided here runs whenever next track is playable
* @param cb The callback function
*/
next(cb: () => unknown): void;
/**
* Callback provided here runs whenever next track is playable
* @param cb The callback function
*/
immediate(cb: () => unknown): void;
private _immediateCall;
private _nextTickCall;
}

@@ -73,2 +188,7 @@

cleanUp(): void;
/**
* Create receiver stream
* @param user The target user to listen to
* @param options Receiver options
*/
createStream(user: UserResolvable, options?: ReceiveStreamOptions): Readable;

@@ -86,9 +206,45 @@ }

constructor(voice: VoiceConnection$1, options: VoiceConnectionData);
/**
* The audio player
*/
get audioPlayer(): _discordjs_voice.AudioPlayer;
/**
* Disconnect from this connection
*/
disconnect(): void;
/**
* Destroy this connection
*/
destroy(): void;
/**
* Create a voice connection
* @param channel The voice channel
* @param manager The voice manager
* @param options Join config
*/
static createConnection(channel: VoiceChannels, manager: DartVoiceManager, options?: VoiceJoinConfig): Promise<VoiceConnection>;
/**
* Join a voice channel
* @param channel The voice channel
* @param options The join config
*/
static joinChannel(channel: VoiceChannels, options?: VoiceJoinConfig): Promise<VoiceConnection$1>;
play(stream: Readable | string, options?: PlayOptions): StreamDispatcher;
/**
* Play readable stream or remote stream source in this connection
* @param stream The stream source
* @param options The play options
*/
play<T = unknown>(stream: Readable | string, options?: PlayOptions<T> & {
behaviours?: {
noSubscriber?: NoSubscriberBehavior;
maxMissedFrames?: number;
};
}): StreamDispatcher<T>;
/**
* The voice connection status
*/
get status(): VoiceConnectionStatus;
/**
* The voice connection latency (udp)
*/
get ping(): number;

@@ -101,11 +257,58 @@ }

constructor(client: Client);
/**
* Join a voice channel
* @param channel The voice based channel
* @param options Join config
*/
join(channel: GuildVoiceChannelResolvable, options?: VoiceJoinConfig): Promise<VoiceConnection>;
/**
* Leave a voice channel
* @param channel The voice channel
*/
leave(channel: GuildVoiceChannelResolvable): void;
/**
* Update voice connection
* @param connection The voice connection
* @param channel The new voice channel
*/
updateChannel(connection: VoiceConnection, channel: VoiceChannels): Promise<VoiceConnection>;
}
interface VolumeTransformerOptions extends TransformOptions {
type?: "s16le" | "s16be" | "s32le" | "s32be";
smoothness?: number;
volume?: number;
}
declare class VolumeTransformer extends Transform {
private _bits;
private _smoothing;
private _bytes;
private _extremum;
private _chunk;
volume: number;
private _targetVolume;
type: "s16le" | "s32le" | "s16be" | "s32be";
constructor(options?: VolumeTransformerOptions);
_readInt(buffer: Buffer, index: number): number;
_writeInt(buffer: Buffer, int: number, index: number): number;
_applySmoothness(): void;
_transform(chunk: Buffer, encoding: BufferEncoding, done: () => unknown): unknown;
_destroy(err: Error, cb: (error: Error) => void): void;
setVolume(volume: number): void;
setVolumeDecibels(db: number): void;
setVolumeLogarithmic(value: number): void;
get volumeDecibels(): number;
get volumeLogarithmic(): number;
get smoothness(): number;
setSmoothness(smoothness: number): void;
smoothingEnabled(): boolean;
get hasSmoothness(): boolean;
static get hasSmoothing(): boolean;
}
declare function catchError<T>(promiseLike: () => Promise<T>): Promise<[Error, T]>;
declare function noop(): void;
declare function wait(duration: number): Promise<unknown>;
declare function randomId(): string;
export { DartVoiceManager, DispatcherEvents, PlayOptions, ReceiveStreamOptions, StreamDispatcher, VoiceChannels, VoiceConnection, VoiceConnectionData, VoiceEvents, VoiceJoinConfig, VoiceReceiver, VoiceReceiverEvents, catchError, noop, wait };
export { DartVoiceManager, DispatcherEvents, PlayOptions, ReceiveStreamOptions, StreamDispatcher, VoiceChannels, VoiceConnection, VoiceConnectionData, VoiceEvents, VoiceJoinConfig, VoiceReceiver, VoiceReceiverEvents, VolumeTransformer, VolumeTransformerOptions, catchError, injectSmoothVolume, noop, randomId, wait };
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -13,3 +17,8 @@ if (k2 === undefined) k2 = k;

Object.defineProperty(exports, "__esModule", { value: true });
exports.VoiceReceiver = exports.VoiceConnection = exports.StreamDispatcher = exports.DartVoiceManager = void 0;
exports.injectSmoothVolume = exports.VolumeTransformer = exports.VoiceReceiver = exports.VoiceConnection = exports.StreamDispatcher = exports.DartVoiceManager = void 0;
const injection_1 = require("./smoothVolume/injection");
Object.defineProperty(exports, "injectSmoothVolume", { enumerable: true, get: function () { return injection_1.injectSmoothVolume; } });
if (!("DARTJS_DISABLE_INJECTION" in process.env)) {
(0, injection_1.injectSmoothVolume)();
}
var DartVoiceManager_1 = require("./core/DartVoiceManager");

@@ -23,3 +32,5 @@ Object.defineProperty(exports, "DartVoiceManager", { enumerable: true, get: function () { return DartVoiceManager_1.DartVoiceManager; } });

Object.defineProperty(exports, "VoiceReceiver", { enumerable: true, get: function () { return VoiceReceiver_1.VoiceReceiver; } });
var VolumeTransformer_1 = require("./smoothVolume/VolumeTransformer");
Object.defineProperty(exports, "VolumeTransformer", { enumerable: true, get: function () { return VolumeTransformer_1.VolumeTransformer; } });
__exportStar(require("./types/types"), exports);
__exportStar(require("./Utils/Util"), exports);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.wait = exports.noop = exports.catchError = void 0;
exports.randomId = exports.wait = exports.noop = exports.catchError = void 0;
function catchError(promiseLike) {

@@ -18,1 +18,5 @@ return new Promise((resolve) => {

exports.wait = wait;
function randomId() {
return `${Date.now()}::${Math.random().toString(32)}`;
}
exports.randomId = randomId;
{
"name": "dartjs",
"version": "1.1.1",
"version": "1.2.0",
"description": "Very simple framework that provides discord.js v12 voice interface",

@@ -37,3 +37,5 @@ "main": "dist/index.js",

"discord.js-v13-voice",
"discord.js-v12-voice-v13"
"discord.js-v12-voice-v13",
"polyfill",
"discord-player"
],

@@ -47,2 +49,3 @@ "author": "DevAndromeda",

"devDependencies": {
"@discordjs/opus": "^0.7.0",
"@favware/rollup-type-bundler": "^1.0.3",

@@ -63,3 +66,3 @@ "@types/node": "^16.7.1",

"youtube-sr": "^4.1.13",
"ytdl-core": "^4.10.1"
"ytdl-core": "^4.11.0"
},

@@ -66,0 +69,0 @@ "dependencies": {

@@ -102,2 +102,24 @@ # DartJS

See **[https://github.com/discord-player/voice-recorder-example](https://github.com/discord-player/voice-recorder-example)** for a complete voice recorder example.
> See **[https://github.com/discord-player/voice-recorder-example](https://github.com/discord-player/voice-recorder-example)** for a complete voice recorder example.
### Smooth Volume
This feature enables smooth volume transition.
> This library will attempt to polyfill smooth volume api by default. This can be disabled by setting `DARTJS_DISABLE_INJECTION` in env.
**Example:**
```js
// injecting manually
require("dartjs").injectSmoothVolume();
// Set smoothness before playing
dispatcher.play(stream, {
// use whatever value feels better
volumeSmoothness: 0.08
});
// setting smoothness on-the-fly
dispatcher.setVolumeSmoothness(0.08)
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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