Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Audio "incoming" event not firing. #259

Open
pantheonsh opened this issue Mar 28, 2018 · 2 comments
Open

Audio "incoming" event not firing. #259

pantheonsh opened this issue Mar 28, 2018 · 2 comments

Comments

@pantheonsh
Copy link

pantheonsh commented Mar 28, 2018

I'm trying to make a voice recorder, but the voice stream doesn't feed data.

`
client.getAudioContext({channelID: member.voice_channel_id, maxStreamSize: config.maxStreamSize * 1024}, function(error, stream) {
let fn = path.join(recordingsPath, Date.now() + ".raw");
let ws = fs.createWriteStream(fn, {end: false});

            stream.on('incoming', function(SSRC, buffer) {
                console.log("packet")
                stream.write(buffer)
                ws.write(buffer);
            });

            stream.pipe(ws);

});`

@pantheonsh
Copy link
Author

console.log-ing line 2431 shows this
{ Error: INVALID_PACKET
at new OpusError (/home/pantheon/Desktop/PadmaRecorder/node_modules/cjopus/lib/Opus.js:128:17)
at OpusEncoder.decode (/home/pantheon/Desktop/PadmaRecorder/node_modules/cjopus/lib/Opus.js:89:30)
at AudioCB.handleIncomingAudio (/home/pantheon/Desktop/PadmaRecorder/node_modules/discord.io/lib/index.js:2423:30)
at Socket.emit (events.js:180:13)
at UDP.onMessage [as onmessage] (dgram.js:659:8) code: -4 }

@PereiraShane
Copy link

Hey, I'm having the same problem, did you find a solution?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants