add @discordjs/opus + jmd.js
This commit is contained in:
26
node_modules/prism-media/package.json
generated
vendored
26
node_modules/prism-media/package.json
generated
vendored
@@ -1,27 +1,27 @@
|
||||
{
|
||||
"_from": "prism-media@^1.2.2",
|
||||
"_id": "prism-media@1.2.3",
|
||||
"_from": "prism-media@^1.2.9",
|
||||
"_id": "prism-media@1.2.9",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A==",
|
||||
"_integrity": "sha512-UHCYuqHipbTR1ZsXr5eg4JUmHER8Ss4YEb9Azn+9zzJ7/jlTtD1h0lc4g6tNx3eMlB8Mp6bfll0LPMAV4R6r3Q==",
|
||||
"_location": "/prism-media",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "prism-media@^1.2.2",
|
||||
"raw": "prism-media@^1.2.9",
|
||||
"name": "prism-media",
|
||||
"escapedName": "prism-media",
|
||||
"rawSpec": "^1.2.2",
|
||||
"rawSpec": "^1.2.9",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.2.2"
|
||||
"fetchSpec": "^1.2.9"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/discord.js"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz",
|
||||
"_shasum": "37bbb11726674a73fe56a2df4de76aa91d2141b7",
|
||||
"_spec": "prism-media@^1.2.2",
|
||||
"_where": "C:\\Users\\j4kub\\Desktop\\code\\git\\gractwo-bot\\node_modules\\discord.js",
|
||||
"_resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.9.tgz",
|
||||
"_shasum": "8d4f97b36efdfc82483eb8d3db64020767866f36",
|
||||
"_spec": "prism-media@^1.2.9",
|
||||
"_where": "C:\\Users\\j4kub\\Desktop\\git\\gractwo-bot\\node_modules\\discord.js",
|
||||
"author": {
|
||||
"name": "Amish Shah",
|
||||
"email": "amishshah.2k@gmail.com"
|
||||
@@ -58,10 +58,10 @@
|
||||
"main": "src/index.js",
|
||||
"name": "prism-media",
|
||||
"peerDependencies": {
|
||||
"@discordjs/opus": "^0.5.0",
|
||||
"ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0",
|
||||
"@discordjs/opus": "^0.3.3",
|
||||
"node-opus": "^0.3.3",
|
||||
"opusscript": "^0.0.7"
|
||||
"opusscript": "^0.0.8"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@discordjs/opus": {
|
||||
@@ -87,5 +87,5 @@
|
||||
"test": "npm run lint && jest && npm run docs"
|
||||
},
|
||||
"types": "typings/index.d.ts",
|
||||
"version": "1.2.3"
|
||||
"version": "1.2.9"
|
||||
}
|
||||
|
||||
7
node_modules/prism-media/src/core/FFmpeg.js
generated
vendored
7
node_modules/prism-media/src/core/FFmpeg.js
generated
vendored
@@ -25,6 +25,7 @@ class FFmpeg extends Duplex {
|
||||
* @memberof core
|
||||
* @param {Object} options Options you would pass to a regular Transform stream, plus an `args` option
|
||||
* @param {Array<string>} options.args Arguments to pass to FFmpeg
|
||||
* @param {boolean} [options.shell=false] Whether FFmpeg should be spawned inside a shell
|
||||
* @example
|
||||
* // By default, if you don't specify an input (`-i ...`) prism will assume you're piping a stream into it.
|
||||
* const transcoder = new prism.FFmpeg({
|
||||
@@ -41,7 +42,7 @@ class FFmpeg extends Duplex {
|
||||
*/
|
||||
constructor(options = {}) {
|
||||
super();
|
||||
this.process = FFmpeg.create(options);
|
||||
this.process = FFmpeg.create({ shell: false, ...options });
|
||||
const EVENTS = {
|
||||
readable: this._reader,
|
||||
data: this._reader,
|
||||
@@ -150,9 +151,9 @@ class FFmpeg extends Duplex {
|
||||
* @private
|
||||
* @throws Will throw an error if FFmpeg cannot be found.
|
||||
*/
|
||||
static create({ args = [] } = {}) {
|
||||
static create({ args = [], shell = false } = {}) {
|
||||
if (!args.includes('-i')) args.unshift('-i', '-');
|
||||
return ChildProcess.spawn(FFmpeg.getInfo().command, args.concat(['pipe:1']), { windowsHide: true });
|
||||
return ChildProcess.spawn(FFmpeg.getInfo().command, args.concat(['pipe:1']), { windowsHide: true, shell });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
5
node_modules/prism-media/src/core/VolumeTransformer.js
generated
vendored
5
node_modules/prism-media/src/core/VolumeTransformer.js
generated
vendored
@@ -66,16 +66,15 @@ class VolumeTransformer extends Transform {
|
||||
chunk = this._chunk = Buffer.concat([this._chunk, chunk]);
|
||||
if (chunk.length < _bytes) return done();
|
||||
|
||||
const transformed = Buffer.allocUnsafe(chunk.length);
|
||||
const complete = Math.floor(chunk.length / _bytes) * _bytes;
|
||||
|
||||
for (let i = 0; i < complete; i += _bytes) {
|
||||
const int = Math.min(_extremum - 1, Math.max(-_extremum, Math.floor(this.volume * this._readInt(chunk, i))));
|
||||
this._writeInt(transformed, int, i);
|
||||
this._writeInt(chunk, int, i);
|
||||
}
|
||||
|
||||
this._chunk = chunk.slice(complete);
|
||||
this.push(transformed);
|
||||
this.push(chunk.slice(0, complete));
|
||||
return done();
|
||||
}
|
||||
|
||||
|
||||
10
node_modules/prism-media/src/opus/Opus.js
generated
vendored
10
node_modules/prism-media/src/opus/Opus.js
generated
vendored
@@ -150,11 +150,11 @@ class Encoder extends OpusStream {
|
||||
this._buffer = Buffer.alloc(0);
|
||||
}
|
||||
|
||||
async _transform(chunk, encoding, done) {
|
||||
_transform(chunk, encoding, done) {
|
||||
this._buffer = Buffer.concat([this._buffer, chunk]);
|
||||
let n = 0;
|
||||
while (this._buffer.length >= this._required * (n + 1)) {
|
||||
const buf = await this._encode(this._buffer.slice(n * this._required, (n + 1) * this._required));
|
||||
const buf = this._encode(this._buffer.slice(n * this._required, (n + 1) * this._required));
|
||||
this.push(buf);
|
||||
n++;
|
||||
}
|
||||
@@ -200,7 +200,11 @@ class Decoder extends OpusStream {
|
||||
this.emit('tags', chunk);
|
||||
return done();
|
||||
}
|
||||
this.push(this._decode(chunk));
|
||||
try {
|
||||
this.push(this._decode(chunk));
|
||||
} catch (e) {
|
||||
return done(e);
|
||||
}
|
||||
return done();
|
||||
}
|
||||
}
|
||||
|
||||
2
node_modules/prism-media/typings/index.d.ts
generated
vendored
2
node_modules/prism-media/typings/index.d.ts
generated
vendored
@@ -8,12 +8,14 @@ import { vorbis } from './vorbis';
|
||||
|
||||
export interface FFmpegOptions {
|
||||
args?: string[];
|
||||
shell?: boolean;
|
||||
}
|
||||
|
||||
export interface FFmpegInfo {
|
||||
command: string;
|
||||
info: string;
|
||||
version: string;
|
||||
output: string;
|
||||
}
|
||||
|
||||
export class FFmpeg extends Duplex {
|
||||
|
||||
Reference in New Issue
Block a user