Fix: Lautstärke während Wiedergabe steuerbar (inlineVolume immer aktiv)

Bei PCM-Memory-Cache wurde inlineVolume nur aktiviert wenn vol != 1,
dadurch fehlte das Volume-Objekt auf der AudioResource und
apiSetVolumeLive konnte die Lautstärke nicht live ändern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel 2026-03-09 23:41:09 +01:00
parent c0956fbc7e
commit 0bd31d93a8

View file

@ -532,7 +532,7 @@ async function playFilePath(guildId: string, channelId: string, filePath: string
if (cachedPath) {
const pcmBuf = getPcmFromMemory(cachedPath);
if (pcmBuf) {
resource = createAudioResource(Readable.from(pcmBuf), { inlineVolume: useVolume !== 1, inputType: StreamType.Raw });
resource = createAudioResource(Readable.from(pcmBuf), { inlineVolume: true, inputType: StreamType.Raw });
} else {
resource = createAudioResource(fs.createReadStream(cachedPath, { highWaterMark: 256 * 1024 }), { inlineVolume: true, inputType: StreamType.Raw });
}