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

Releases: discordjs/voice

0.5.2

03 Jul 22:26
Compare
Choose a tag to compare
  • Fixes issues where intellisense is unavailable when used alongside discord.js

  • fix(TypeScript): bundle types at prepublishOnly (#149)

    • fix(typescript): bundle types at prepublishOnly

    This is required to support proper module augmentation with
    declare module '@discordjs/voice' { } because TypeScript doesn't
    propegate module augmentations when only
    targeting the root index.d.ts, even when that
    file is re-exporting other types.

    It's an issue we faced with Sapphire Framework & Pieces and easily fixed
    by bundling up all the types using Rollup.

    • chore: switch to cli package

    • chore: add rtb config file

    • chore: remove config and update cli tool

  • chore(Release): v0.5.2

0.5.1

26 Jun 12:26
Compare
Choose a tag to compare

Changes

  • Better type inference when using event listeners for specific transitions, e.g.
    voiceConnection.on(VoiceConnectionStatus.Ready, (oldState, newState) => {
      // newState is now inferred to be the Ready state
    });
  • Fixes to the rejoin and disconnect methods of VoiceConnection

Commit Log

  • docs(Examples): add a JavaScript example (#127)

    • docs(Examples): create radio bot example

    • chore(Examples): create overview README

    • chore(Examples): linting and consistency

  • feat: strengthen new state type for status events (#132)

    • fix(VoiceConnection): strengthen new state type for status events

    • fix(AudioPlayerEvents): strengthen new state type for status events

    • fix(Events): type error when emitting status

  • fix(VoiceConnection): stuck on signalling state when rejoining the same channel on ready state (#139)

    • fix(VoiceConnection): stuck on signalling state

    when rejoining the same channel on ready state

    • test(VoiceConnection): rejoins in a ready state

    • fix: remove checking channelId

  • fix(VoiceConnection): disconnect method now actually disconnects (#140)

    • test(VoiceConnection): expose broken disconnect

    • fix(VoiceConnection): disconnect method

    • refactor(VoiceConnection): remove Object.assign

  • chore(Release): v0.5.1

0.5.0

16 Jun 16:24
Compare
Choose a tag to compare

VoiceConnection changes

  • new disconnect() method if you want to disconnect the connection without destroying it
  • reconnect() -> rejoin(joinConfig?)
    • This and the below change were to improve clarity. What this method does is actually try to re-join a voice channel (rather than try to fix a broken voice connection)
  • reconnectAttempts -> rejoinAttempts
  • calling joinVoiceChannel when an existing connection exists that is disconnected will now call rejoin() on that connection

Other

  • Nicer errors are thrown when you don't have a valid encryption package installed
  • Some improvements to the music bot example

Commit log

  • fix(Examples): youtube-dl-exec args

    Passing q: true worked on Ubuntu, but on some other systems, this was parsed as -q true rather than -q.

  • refactor(Examples): remove unnecessary guard in music bot example

    Resolves #125

  • feat!(VoiceConnection): add disconnect and rename reconnect to rejoin (#129)

    • fix(VoiceConnection): reconnect now sets proper disconnect reason

    • feat(VoiceConnection): disconnect method

    • refactor(VoiceConnection): reconnect -> rejoin

    • feat(VoiceConnection): allow updating joinConfig

    • refactor(VoiceConnection): allow rejoin in non-destroyed states

    • refactor(VoiceConnection): reconnectAttempts -> rejoinAttempts

    • test(VoiceConnection): new methods

    • refactor(VoiceConnection): remove negated if statement

  • feat(Secretbox): throw fallback error when no encryption package installed (#130)

    • feat(Secretbox): display fallback error when no valid installation

    • test(Secretbox): no errors thrown with package installed

    • test(Secretbox): fix tweetnacl test

  • refactor(Secretbox): type methods object (#131) - Antonio Román [email protected]

  • chore(Release): v0.5.0

0.4.0

14 Jun 09:02
Compare
Choose a tag to compare

New features

Opus audio probing utility

The new probing utility lets you figure out whether it's possible to demux your ReadableStream with an Ogg/WebM demuxer, rather than passing it to FFmpeg straight away. This enables you to make some performance improvements:

import { createReadStream } from 'fs';
import { StreamType, demuxProbe, createAudioResource } from '@discordjs/voice';

async function start() {
  // Example verifications
  assert.equal((await demuxProbe(createReadStream('file.mp3'))).type, StreamType.Arbitrary);
  assert.equal((await demuxProbe(createReadStream('file.opus'))).type, StreamType.OggOpus);
  assert.equal((await demuxProbe(createReadStream('file.webm'))).type, StreamType.WebmOpus);

  // Example of creating an audio resource using the probe
  const input = createReadStream('./song.unknownextension');
  const { stream, type } = await demuxProbe(input);
  createAudioResource(stream, { inputType: type });
}

Silence padding for audio resources

By default, all audio resources now end with 5 packets of silence to avoid interpolation noises. See #120 on examples of configurability.

Other

  • You can now use event handlers that return void | Promise<void>, since the latter is handled exactly the same as a void return in Node.js v16
  • The music bot example has been refactored to use youtube-dl instead of ytdl-core/ytdl-core-discord for streaming videos due to its reliability.

Commits

  • feat(Util): add Opus audio probing utility (#118)

    • chore(Deps): update prism-media

    • feat(Util): opus demux probe tool

    • feat: update music bot example

    • refactor(Util): remove unnecessary log

    • chore: update typescript dep in example

    • chore(Util): add docs to demuxProbe

    • chore: update discord.js dep and set download limit cap in example

    • refactor: use youtube-dl-exec instead of child_process

    • test(Util): initial demuxProbe test

    • test(Util): remaining demuxProbe tests

    • refactor: combine event listener bindings in docs

    • refactor: use promises properly in example

    • docs(Util): write docs for ProbeInfo

    • refactor: use probe.stream in music bot example

  • feat!: add silence padding frames to AudioResources (#120)

    • feat(AudioResource): add ended getter

    • feat(AudioResource): silence padding frames

    • test(AudioResource): silence padding frames

    • feat(AudioPlayer): stop() respects silent padding by default

    • test(AudioPlayer): stop() will play silence frames

    • feat(AudioResource): use silenceRemaining in ended

    • test(AudioResource): read() after silence ends

  • feat: allow awaitable void event listeners, fix VoiceConnection disconnected states (#121)

    • feat: use Awaited for event emitters

    Credit to Kyra for the Awaited implementation in discord.js

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

    • fix(Example): improve reconnection logic

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

  • chore(Examples): re-enable eslint rule

  • chore(Release): v0.4.0

0.3.1

11 Jun 11:47
Compare
Choose a tag to compare
  • chore(Legal): added UNLICENSE in examples (#111)

  • chore: update package description

  • chore(README): improve wording

  • fix(Util): increase search depth for dependencies

  • fix(AudioResource): improve accuracy of function signatures (#113)

    • fix(AudioResource): invalid typings

    • refactor(AudioResource): improve typing

    • fix(AudioResource): improve typings

    • fix(AudioResource): function signature types

    • fix(AudioResource): function signature type

  • chore(Deps): update discord.js dep in music bot example (#114)

  • chore(Release): v0.3.1

0.3.0

09 Jun 10:11
Compare
Choose a tag to compare
  • chore(README): use new blurple for discord.js server badge (#108)

  • chore(Deps): update dependencies (#109)

    • chore(Deps): update dependencies

    • chore: disable eslint(no-redeclare)

    • chore(Deps): use tiny-typed-emitter instead of typed-emitter

    • test(VoiceUDPSocket): fix failing tests after updating jest

    • chore(Deps): move tiny-type-emitter

    • chore(Deps): update lockfile

    • chore(Deps): make discord-api-types regular dep

    • chore(Deps): add @types/ws as normal dep

  • docs: music bot example (#107)

    • docs: create music bot example

    • chore: add README to the example

    • chore: fix typo in auth example file

    • refactor: remove TrackMetadata, use Track

    • docs: add explanations to music bot example

    • fix: queueLock not being released

    • docs: document music bot discord.js code

    • refactor: use commands.set in example

    • chore: create eslint file for example

    • fix: defer interaction on play command

    • docs: respond with errors to invalid command usage

    • docs: fix linter error

    • fix: use followUp for deferred interactions

    • chore: update discord-api-types dep in example

    • feat: apply suggestions from code review

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

    • feat: fallback for unknown commands

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

  • feat(AudioResource): add encoder property, fix type for metadata (#110)

    • fix(AudioResource): inaccuracy in types

    • refactor(AudioResource): include encoder stream

    • refactor(AudioResource): simplify constructor

    • test(AudioResource): check values of encoder property

    • refactor(AudioResource): rename pipeline to edges

    • refactor(AudioResource): mark edges array as readonly

    • refactor(AudioResource): use null instead of undefined

  • chore(README): add features list, useful links

  • chore(Release): v0.3.0

0.2.1

07 Jun 21:20
Compare
Choose a tag to compare
0.2.1 Pre-release
Pre-release
  • fix(AudioPlayer): enter Buffering state for resources that are not yet readable (#98)

    • fix(AudioPlayer): enter Buffering state

    • test(AudioPlayer): fix some existing tests

    • test(AudioPlayer): test Buffering state

    • test(AudioPlayer): remove unnecessary assertion

  • fix(VoiceConnection): handle nullable endpoint in voice server update payload (#100)

    • fix(VoiceConnection): handle null endpoint

    • test(VoiceConnection): null endpoint handling

    • chore(Deps): bump discord-api-types to 0.15.1

  • chore: update package author email address

  • refactor(Adapter): sendPayload now returns boolean (#105)

    • refactor(Adapter): sendPayload now returns boolean

    • test(VoiceConnection): behaviours with failed sendPayload

    • chore: fix linter errors

    • chore(Deps): downgrade TypeScript for TypeDoc support

    • chore: update adapter example

  • feat: reason in VoiceConnectionDisconnectedState

  • ci: add Node.js v16 runs to workflows

  • fix(AudioPlayer): strengthen error event type

  • fix(VoiceUDPSocket): catch socket close failure

  • chore(Release): v0.2.1

0.2.0

04 Apr 18:50
Compare
Choose a tag to compare
0.2.0 Pre-release
Pre-release
  • feat!: keep alive mechanism to detect connectivity to Discord (#89)

    • refactor: simplify IP and port udp socket code

    • test: make sure to destroy udp sockets after test runs

    • feat: udp keep alive

    • chore: remove debug statement

    • feat(VoiceConnection): expose udp socket keep alive ping

    • test(VoiceUDPSocket): keep alive mechanism

    • fix: emit close instead of error

    • feat(VoiceUDPSocket): emit debug message

  • feat: implement voice receive (#87)

    • feat: allow specifying selfDeaf/selfMute when joining a voice channel

    • feat: emit messages from UDP

    • feat: create VoiceReceiver class

    • feat: export receiver

    • feat: ssrc discovery

    • feat: packet decryption

    • feat: use fix from sudo-carson

    See discordjs/discord.js@c84a157

    • style: remove unnecessary object spread

    • feat: ssrc map logic

    • feat: add audio receive stream

    • refactor(VoiceReceiver): rename some things

    • fix(VoiceReceiver): listen to stream close instead of end

    • feat(VoiceReceiver): destroy stream on error

    • docs(VoiceReceiver): add documentation

    • docs(AudioReceiveStream): add documentation

    • docs: add documentation for SSRCMap

    • fix(VoiceReceiver): use new ssrc map methods

    • refactor: used typed emitter for SSRCMap

    • test(VoiceUDPSocket): fix tests

    • test: add tests for SSRCMap

    • fix(VoiceReceiver): ignore short messages

    • test(VoiceReceiver): onUdpMessage

    • test(VoiceReceiver): susbcribe

    • test(VoiceReceiver): onWsPacket

    • test(VoiceReceiver): tracking state changes

    • test(VoiceReceiver): immediate binding

    • chore: fix coverage rule

    • test(VoiceReceiver): use RTP packets from different clients

    • feat(VoiceReceiver): play silence frame if nothing has been played yet

    • refactor(VoiceReceiver): reduce duplicated code

  • feat(VoiceUDPSocket): use new IP discovery packet format (#90)

  • feat: use typed event emitters internally (#91)

    • refactor(VoiceUDPSocket): use typed event emitter

    • refactor(VoiceWebSocket): use typed event emitter

    • refactor(Networking): use typed event emitter

  • chore(Deps): update dependencies

  • chore(Release): v0.2.0

0.1.3

31 Mar 11:52
Compare
Choose a tag to compare
0.1.3 Pre-release
Pre-release
  • test(VoiceUDPSocket): unit tests (#82)

    • test(VoiceUDPSocket): unit tests

    • fix(VoiceUDPSocket): fix issues found in unit tests

    • refactor(VoiceUDPSocket): code review

    • refactor(VoiceUDPSocket): use .off instead of .removeListener

  • feat: add ping stats (#77)

    • feat(VoiceWebSocket): ping recording

    • feat(VoiceConnection): expose ping property

    • chore(Deps): install mock-socket and jest-websocket-mock

    • refactor(VoiceWebSocket): use browser WS API

    • chore: set up ws mock

    • test(VoiceWebSocket): packet parsing

    • test(VoiceWebSocket): event propagation

    • fix(VoiceWebSocket): heartbeat ack logic

    • test(VoiceWebSocket): heartbeat flow

    • test(VoiceWebSocket): ping

  • docs(README): fix branch in contributing link (#88)

  • feat: createAudioResource now infers stream type (#85)

    • feat: createAudioResource now infers stream type

    • feat: infer from OggOpusDemuxer streams

    • test: first createAudioResource test

    • fix: type in AudioResource test

    • feat(AudioResource): infer stream type for WebmDemuxer

    • test(AudioResource): inferring stream types

    • test(AudioResource): add remaining inference test

  • chore: publish documentation and use typed events (#84)

    • chore: install typedoc

    • chore: fix generateDependencyReport export

    • docs: clean up AudioPlayer docs

    • chore: export AudioPlayerError

    • docs: clean up AudioResource docs

    • docs: clean up adapter docs

    • docs: clean up entersState docs

    • docs: clean up joinVoiceChannel docs

    • docs: clean up VoiceConnection docs

    • docs: add typed events for VoiceConnection

    • docs: typed events for AudioPlayer

    • chore(GitHub): add docs CI workflow

    • chore(GitHub): only run docs workflow on push

    • chore: fix docs formatting

  • chore(Release): v0.1.3

0.1.2

17 Mar 10:31
Compare
Choose a tag to compare
0.1.2 Pre-release
Pre-release
  • feat: stream time statistics (#75)

    • feat(AudioResource): add playbackDuration

    • feat(AudioPlayer): add playbackDuration

    • test(AudioPlayer): playbackDuration

  • refactor: split states into a union of interfaces (#76)

    • refactor(AudioPlayer): split states into separate interfaces

    • refactor(AudioPlayer): pass state to preparePacket

    • refactor(VoiceConnection): split states into separate interfaces

    • refactor(Networking): split states into separate interfaces

  • test(VoiceConnection): add unit tests (#80)

    • test(VoiceConnection): createVoiceConnection

    • test(VoiceConnection): addServerPacket

    • test(VoiceConnection): addStatePacket

    • refactor: reduce code duplication in tests

    • test(VoiceConnection): configureNetworking

    • test(VoiceConnection): onNetworkingClose

    • fix(VoiceConnection): inc reconnectAttempts when done automatically

    • test(VoiceConnection): onNetworkingStateChange

    • test(VoiceConnection): destroy

    • test(VoiceConnection): reconnect

    • test(VoiceConnection): subscribe

    • test(VoiceConnection): onSubscriptionRemoved

    • refactor: dummy instead of fake

    • test(VoiceConnection): strengthen onSubscriptionRemoved tests

    • refactor(VoiceConnection): make adapter bindings testable

    • test(VoiceConnection): adapter bindings

  • feat: allow adapter creator to call a destroy method (#79)

    • feat: add required destroy methods to both implementers

    • feat(VoiceConnection): implement new adapter destroy method

    • feat: update the adapter example

    • refactor: remove non-null assertion from adapter example

    • fix: logical bug in adapter

    • test(VoiceConnection): adapter destroy

  • chore(Release): v0.1.2