Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(TransformerGraph): Explicitly include input args for readable inp…
…ut cases instead of just for string input cases (#9793)

Explicitly add input args for readable input cases instead of just for string input cases.
Change also ensures that constant arrays are passed by value instead of by reference, preventing them from accidentally being modified.

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
  • Loading branch information
White-Wolf and Jiralite committed Aug 23, 2023
1 parent f6c7c14 commit 788888a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/voice/src/audio/TransformerGraph.ts
Expand Up @@ -151,7 +151,7 @@ const FFMPEG_PCM_EDGE: Omit<Edge, 'from'> = {
cost: 2,
transformer: (input) =>
new prism.FFmpeg({
args: typeof input === 'string' ? ['-i', input, ...FFMPEG_PCM_ARGUMENTS] : FFMPEG_PCM_ARGUMENTS,
args: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_PCM_ARGUMENTS],
}),
};

Expand Down Expand Up @@ -182,7 +182,7 @@ if (canEnableFFmpegOptimizations()) {
cost: 2,
transformer: (input) =>
new prism.FFmpeg({
args: typeof input === 'string' ? ['-i', input, ...FFMPEG_OPUS_ARGUMENTS] : FFMPEG_OPUS_ARGUMENTS,
args: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_OPUS_ARGUMENTS],
}),
};
getNode(StreamType.Arbitrary).addEdge(FFMPEG_OGG_EDGE);
Expand Down

0 comments on commit 788888a

Please sign in to comment.