discordjs / voice

Implementation of the Discord Voice API for discord.js and other JS/TS libraries
Apache License 2.0
327 stars 111 forks source link

Player Idle for custom ffmpeg stream #214

Open darshan-genea opened 2 years ago

darshan-genea commented 2 years ago

Please describe the problem you are having in as much detail as possible:

getAudio() {
        return new prism.FFmpeg({
            args: [
                '-analyzeduration', '0',
                '-loglevel', '0',
                '-f', 'pulse',
                '-i', 'alsa_output.platform-snd_aloop.0.analog-stereo.monitor',
                '-acodec', 'libopus',
                '-f', 'opus',
                '-ar', '48000',
                '-ac', '2',
            ],
        })
    }
player.play(createAudioResource(getAudio(), { inputType: StreamType.OggOpus }))
// Player goes Idle as soon as invoke play function
// This works - ffmpeg -analyzeduration 0  -f pulse -i alsa_output.platform-snd_aloop.0.analog-stereo.monitor -acodec libopus -f opus -ar 48000 -ac 2 output.ogg

Further details:

Relevant client options: