voice: reimplement seek option (#2572)

This commit is contained in:
Amish Shah
2018-06-13 21:16:14 +01:00
parent 04618f554f
commit 1cdee7b48a
2 changed files with 4 additions and 1 deletions

View File

@@ -44,7 +44,10 @@ class BasePlayer extends EventEmitter {
this.destroyDispatcher();
const isStream = input instanceof ReadableStream;
const args = isStream ? FFMPEG_ARGUMENTS : ['-i', input, ...FFMPEG_ARGUMENTS];
if (options.seek) args.push('-ss', String(options.seek));
const ffmpeg = new prism.FFmpeg({ args });
const streams = { ffmpeg };
if (isStream) {