You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
`// Join with selfDeaf set to false to receive audio
const voiceConnection = joinChannel({ ...options, selfDeaf: false });
voiceConnection.receiver.speaking.on('start', userId => console.log(`User ${userId} started speaking`));
voiceConnection.receiver.speaking.on('end', userId => console.log(`User ${userId} stopped speaking`));
// A Readable object mode stream of Opus packets
// Will only end when the voice connection is destroyed
voiceConnection.receiver.subscribe(userId);
// A Readable object mode stream of Opus packets
// Will end when the voice connection is destroyed, or the user has not said anything for 100ms
const opusStream = voiceConnection.receiver.subscribe(userId, {
end: {
behavior: EndBehaviorType.AfterSilence,
duration: 100,
},
});
// -------------------------
// You can re-use the Opus stream, e.g. to play in another channel as an echo
const resource = createAudioResource(opusStream, { inputType: StreamType.Opus });
// You can decode the Opus stream to raw audio using prism-media
const rawAudio = opusStream.pipe(new prism.opus.Decoder({ frameSize: 960, channels: 2, rate: 48000 }));
// You can save the stream to an Ogg file using [email protected]
const oggWriter = new opus.OggLogicalBitstream({
opusHead: new opus.OpusHead({
channelCount: 2,
sampleRate: 48000,
}),
pageSizeControl: {
maxPackets: 10,
},
});
pipeline(opusStream, oggWriter, createWriteStream('./myfile.ogg'), callback);`
This should be present in here.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have no idea why the v11 and bellow examples are so much more simple than this. Splitting the files just makes it hard to interpret this.
The text was updated successfully, but these errors were encountered: