Skip to content

Commit 5a6caa0

Browse files
committed
Audio sampling rate should match bitrate
1 parent af15f07 commit 5a6caa0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Discord/Voice/VoiceClient.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,15 +1992,17 @@ public function ffmpegEncode(?string $filename = null, ?array $preArgs = null):
19921992
default => -40 + ($this->volume / 100) * 40,
19931993
};
19941994

1995+
$bitrate = $this->getChannel()->bitrate;
1996+
19951997
$flags = [
19961998
'-i', $filename ?? 'pipe:0',
19971999
'-map_metadata', '-1',
19982000
'-f', 'opus',
19992001
'-c:a', 'libopus',
2000-
'-ar', '48000',
2002+
'-ar', $bitrate,
20012003
'-af', 'volume='.$dB.'dB',
20022004
'-ac', '2',
2003-
'-b:a', $this->getChannel()->bitrate,
2005+
'-b:a', $bitrate,
20042006
'-loglevel', 'warning',
20052007
'pipe:1',
20062008
];

0 commit comments

Comments
 (0)