#How to format data when using StreamType.Raw or StreamType.Opus

1 messages · Page 1 of 1 (latest)

glossy atlas

I have a program that can send either Opus data or PCM data (I can choose one of the two), and I have a discord bot that can receive that data. The only way I've gotten it to play properly in a voice channel is by using StreamType.Arbitrary and manually adding a WAV header to the resource. If I try to use StreamType.Raw to play PCM data, the audio comes out twice as fast, and if I use Opus, it comes out so fast I can barely even hear the music. I assume it must be because discord.js/voice is treating the stereo audio as if it was mono, but I have no idea and I have even less of an idea of what to do to fix this aside from just using StreamType.Arbitrary.