Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Releases: discordjs/voice

0.7.4

12 Nov 09:29
3bfaebf
Compare
Choose a tag to compare

Bug Fixes

  • conditionally apply banner only to esm build (8c4e8c4)

0.7.3

11 Nov 06:19
23e6efb
Compare
Choose a tag to compare

Bug Fixes

0.7.2

30 Oct 23:26
9c92483
Compare
Choose a tag to compare

Bug Fixes

0.7.1

30 Oct 20:13
7b5523a
Compare
Choose a tag to compare

Bug Fixes

0.7.0

30 Oct 07:34
7e493c7
Compare
Choose a tag to compare

Features

  • export some types so they render in docs (#211) (a6dad47)

0.6.0

10 Aug 19:03
Compare
Choose a tag to compare

Voice Receive

v0.6.0 makes voice receive useable with many utility additions. You can see a run-down below, or view the full recorder example.

Audio receive streams automatically close when their attached voice connection is destroyed.

// 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);

Commit log

  • chore: update conventional commit URL (#167)

  • test(DataStore): add missing tests (#165)

    • tests(DataStore): add missing tests

    • test(DataStore): add function spys for frame prep

  • refactor(AudioPlayer): use this.once instead of events.once (#162)

  • feat(Util): support AbortSignal in entersState (#171)

    • refactor(Util): use AbortSignal in entersState

    • chore(CI): drop Node v14 from CI

    • refactor(Util): remove unnecessary function

    • test(Util): add tests for abortAfter

    • test(Util): add test for entersState

  • refactor(Examples): remove unused imported binding (#172)

  • feat(VoiceReceive)!: improve usability (#136)

    • refactor(VoiceReceiver): begin refactor

    • feat(SSRCMap): resolve function

    • feat(VoiceConnection): close all streams in non-ready state

    • refactor(VoiceReceiver): map by user ID

    • feat(VoiceReceiver): allow specifying end type for streams

    • feat(VoiceReceiver): add SpeakingMap

    • refactor(SSRCMap): remove unused resolve method

    • test(VoiceReceiver): add test for SpeakingMap

    • test(VoiceReceiver): add tests for AudioReceiveStream

    • test(AudioReceiver): strengthen AudioReceiveStream tests

    • test(VoiceReceiver): remove inapplicable tests

    • test(VoiceConnection): fix test errors

    • test(VoiceConnection): test receiver bindings tracking

    • test(VoiceReceiver): decrypt

    • chore: remove unused code

    • fix(AudioReceiveStream): close normally

    • feat(Examples): update receiver example

    • feat(Examples): create recorder example

    • docs(VoiceReceiver): add docs for receive classes

    • refactor: suggestions from code review

    Co-authored-by: Antonio Román [email protected]

    Co-authored-by: Antonio Román [email protected]

  • chore(Release): v0.6.0

0.5.6

07 Aug 20:04
Compare
Choose a tag to compare

A hotfix to resolve type errors when used with discord.js v13.


  • chore(Deps): update discord-api-types to 0.22.0

  • chore(Release): v0.5.6

0.5.5

25 Jul 11:05
Compare
Choose a tag to compare
  • chore(Deps): update discord-api-types to 0.19.0 (#154)

  • fix(Examples): change guildID to guildId (#155)

  • refactor(ConnectionOptions): change xID to xId (#156)

    • refactor(Networking): change xID to xId

    • fix: tests

    • fix: correct method names

  • refactor(Examples): update events and fix compilation errors on newer versions of TypeScript (#159)

    • message and interaction event updated in examples

    • message event in other examples

    • subscription setTimeout and error type fix

    • Update package.json

    • subscription fix 2

  • fix(Examples): destroy discord.js v12 adapter less readily (#160)

    • fix(Examples): destroy discord.js v12 adapter less readily

    • refactor(Examples): delete adapters instead of setting empty set

    • refactor(Examples): consistent Id/ID casing

  • chore(Release): v0.5.5

0.5.4

13 Jul 16:23
Compare
Choose a tag to compare

New feature

  • Can now use groups (namespaces) for voice connections, allowing you to have multiple bots connect to the same guild's voice channels:
joinVoiceChannel({ ...options }); // group defaults to "default"
joinVoiceChannel({ ...options1, group: bot1.user.id });
joinVoiceChannel({ ...options2, group: bot2.user.id });
joinVoiceChannel({ ...options3, group: bot3.user.id });

getVoiceConnection(options.guildId); // the first voice connection
getVoiceConnection(options.guildId, bot3.user.id); // the last voice connection

getVoiceConnections(bot3.user.id); // get all voice connections in the group = bot3.user.id
getVoiceConnections(); // get all voice connections in the group = "default"

getGroups(); // get all groups/namespaces

  • feat: voice channel groups (#147)

    • feat: add group discriminator to voice connections

    • feat(DataStore): expose voice connections map

    • feat(DataStore): use 2D map to store voice connections

    • chore(Examples): update ytdl-core dependency

    • refactor(DataStore): remove unnecessary type

    • refactor(DataStore): allow optional return type for getVoiceConnections

    • test(DataStore): check default and custom groups work

  • chore(Release): v0.5.4

0.5.3

04 Jul 19:35
0a0b835
Compare
Choose a tag to compare
  • Fixes issues where intellisense is unavailable when used alongside discord.js

  • fix: fixed type bundling for real (#151)

  • 0.5.3