@discordjs/voice 1.0.0-dev.1748174703-c1f5bb2fb → 1.0.0-dev.1748347528-2c35084ec

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -442,11 +442,11 @@ declare class AudioPlayer extends EventEmitter {
442
442
  private unsubscribe;
443
443
  /**
444
444
  * The state that the player is in.
445
+ *
446
+ * @remarks
447
+ * The setter will perform clean-up operations where necessary.
445
448
  */
446
449
  get state(): AudioPlayerState;
447
- /**
448
- * Sets a new state for the player, performing clean-up operations where necessary.
449
- */
450
450
  set state(newState: AudioPlayerState);
451
451
  /**
452
452
  * Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed
@@ -865,11 +865,11 @@ declare class Networking extends EventEmitter {
865
865
  destroy(): void;
866
866
  /**
867
867
  * The current state of the networking instance.
868
+ *
869
+ * @remarks
870
+ * The setter will perform clean-up operations where necessary.
868
871
  */
869
872
  get state(): NetworkingState;
870
- /**
871
- * Sets a new state for the networking instance, performing clean-up operations where necessary.
872
- */
873
873
  set state(newState: NetworkingState);
874
874
  /**
875
875
  * Creates a new WebSocket to a Discord Voice gateway.
@@ -1392,11 +1392,11 @@ declare class VoiceConnection extends EventEmitter {
1392
1392
  constructor(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions);
1393
1393
  /**
1394
1394
  * The current state of the voice connection.
1395
+ *
1396
+ * @remarks
1397
+ * The setter will perform clean-up operations where necessary.
1395
1398
  */
1396
1399
  get state(): VoiceConnectionState;
1397
- /**
1398
- * Updates the state of the voice connection, performing clean-up operations where necessary.
1399
- */
1400
1400
  set state(newState: VoiceConnectionState);
1401
1401
  /**
1402
1402
  * Registers a `VOICE_SERVER_UPDATE` packet to the voice connection. This will cause it to reconnect using the
@@ -1641,4 +1641,4 @@ declare function demuxProbe(stream: Readable, probeSize?: number, validator?: ty
1641
1641
  */
1642
1642
  declare const version: string;
1643
1643
 
1644
- export { AudioPlayer, type AudioPlayerBufferingState, AudioPlayerError, type AudioPlayerIdleState, type AudioPlayerPausedState, type AudioPlayerPlayingState, type AudioPlayerState, AudioPlayerStatus, AudioReceiveStream, type AudioReceiveStreamOptions, AudioResource, type CreateAudioPlayerOptions, type CreateAudioResourceOptions, type CreateVoiceConnectionOptions, type DiscordGatewayAdapterCreator, type DiscordGatewayAdapterImplementerMethods, type DiscordGatewayAdapterLibraryMethods, type EndBehavior, EndBehaviorType, type JoinConfig, type JoinVoiceChannelOptions, NoSubscriberBehavior, PlayerSubscription, type ProbeInfo, SSRCMap, SpeakingMap, StreamType, VoiceConnection, type VoiceConnectionConnectingState, type VoiceConnectionDestroyedState, VoiceConnectionDisconnectReason, type VoiceConnectionDisconnectedBaseState, type VoiceConnectionDisconnectedOtherState, type VoiceConnectionDisconnectedState, type VoiceConnectionDisconnectedWebSocketState, type VoiceConnectionReadyState, type VoiceConnectionSignallingState, type VoiceConnectionState, VoiceConnectionStatus, VoiceReceiver, type VoiceUserData, createAudioPlayer, createAudioResource, createDefaultAudioReceiveStreamOptions, demuxProbe, entersState, generateDependencyReport, getGroups, getVoiceConnection, getVoiceConnections, joinVoiceChannel, validateDiscordOpusHead, version };
1644
+ export { AudioPlayer, type AudioPlayerBufferingState, AudioPlayerError, type AudioPlayerIdleState, type AudioPlayerPausedState, type AudioPlayerPlayingState, type AudioPlayerState, AudioPlayerStatus, AudioReceiveStream, type AudioReceiveStreamOptions, AudioResource, type ConnectionData, type ConnectionOptions, type CreateAudioPlayerOptions, type CreateAudioResourceOptions, type CreateVoiceConnectionOptions, type DiscordGatewayAdapterCreator, type DiscordGatewayAdapterImplementerMethods, type DiscordGatewayAdapterLibraryMethods, type Edge, type EndBehavior, EndBehaviorType, type JoinConfig, type JoinVoiceChannelOptions, Networking, type NetworkingClosedState, type NetworkingIdentifyingState, type NetworkingOpeningWsState, type NetworkingReadyState, type NetworkingResumingState, type NetworkingSelectingProtocolState, type NetworkingState, NetworkingStatusCode, type NetworkingUdpHandshakingState, NoSubscriberBehavior, Node, PlayerSubscription, type ProbeInfo, SSRCMap, type SocketConfig, SpeakingMap, StreamType, TransformerType, VoiceConnection, type VoiceConnectionConnectingState, type VoiceConnectionDestroyedState, VoiceConnectionDisconnectReason, type VoiceConnectionDisconnectedBaseState, type VoiceConnectionDisconnectedOtherState, type VoiceConnectionDisconnectedState, type VoiceConnectionDisconnectedWebSocketState, type VoiceConnectionReadyState, type VoiceConnectionSignallingState, type VoiceConnectionState, VoiceConnectionStatus, VoiceReceiver, VoiceUDPSocket, type VoiceUserData, VoiceWebSocket, createAudioPlayer, createAudioResource, createDefaultAudioReceiveStreamOptions, demuxProbe, entersState, generateDependencyReport, getGroups, getVoiceConnection, getVoiceConnections, joinVoiceChannel, validateDiscordOpusHead, version };
package/dist/index.d.ts CHANGED
@@ -442,11 +442,11 @@ declare class AudioPlayer extends EventEmitter {
442
442
  private unsubscribe;
443
443
  /**
444
444
  * The state that the player is in.
445
+ *
446
+ * @remarks
447
+ * The setter will perform clean-up operations where necessary.
445
448
  */
446
449
  get state(): AudioPlayerState;
447
- /**
448
- * Sets a new state for the player, performing clean-up operations where necessary.
449
- */
450
450
  set state(newState: AudioPlayerState);
451
451
  /**
452
452
  * Plays a new resource on the player. If the player is already playing a resource, the existing resource is destroyed
@@ -865,11 +865,11 @@ declare class Networking extends EventEmitter {
865
865
  destroy(): void;
866
866
  /**
867
867
  * The current state of the networking instance.
868
+ *
869
+ * @remarks
870
+ * The setter will perform clean-up operations where necessary.
868
871
  */
869
872
  get state(): NetworkingState;
870
- /**
871
- * Sets a new state for the networking instance, performing clean-up operations where necessary.
872
- */
873
873
  set state(newState: NetworkingState);
874
874
  /**
875
875
  * Creates a new WebSocket to a Discord Voice gateway.
@@ -1392,11 +1392,11 @@ declare class VoiceConnection extends EventEmitter {
1392
1392
  constructor(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions);
1393
1393
  /**
1394
1394
  * The current state of the voice connection.
1395
+ *
1396
+ * @remarks
1397
+ * The setter will perform clean-up operations where necessary.
1395
1398
  */
1396
1399
  get state(): VoiceConnectionState;
1397
- /**
1398
- * Updates the state of the voice connection, performing clean-up operations where necessary.
1399
- */
1400
1400
  set state(newState: VoiceConnectionState);
1401
1401
  /**
1402
1402
  * Registers a `VOICE_SERVER_UPDATE` packet to the voice connection. This will cause it to reconnect using the
@@ -1641,4 +1641,4 @@ declare function demuxProbe(stream: Readable, probeSize?: number, validator?: ty
1641
1641
  */
1642
1642
  declare const version: string;
1643
1643
 
1644
- export { AudioPlayer, type AudioPlayerBufferingState, AudioPlayerError, type AudioPlayerIdleState, type AudioPlayerPausedState, type AudioPlayerPlayingState, type AudioPlayerState, AudioPlayerStatus, AudioReceiveStream, type AudioReceiveStreamOptions, AudioResource, type CreateAudioPlayerOptions, type CreateAudioResourceOptions, type CreateVoiceConnectionOptions, type DiscordGatewayAdapterCreator, type DiscordGatewayAdapterImplementerMethods, type DiscordGatewayAdapterLibraryMethods, type EndBehavior, EndBehaviorType, type JoinConfig, type JoinVoiceChannelOptions, NoSubscriberBehavior, PlayerSubscription, type ProbeInfo, SSRCMap, SpeakingMap, StreamType, VoiceConnection, type VoiceConnectionConnectingState, type VoiceConnectionDestroyedState, VoiceConnectionDisconnectReason, type VoiceConnectionDisconnectedBaseState, type VoiceConnectionDisconnectedOtherState, type VoiceConnectionDisconnectedState, type VoiceConnectionDisconnectedWebSocketState, type VoiceConnectionReadyState, type VoiceConnectionSignallingState, type VoiceConnectionState, VoiceConnectionStatus, VoiceReceiver, type VoiceUserData, createAudioPlayer, createAudioResource, createDefaultAudioReceiveStreamOptions, demuxProbe, entersState, generateDependencyReport, getGroups, getVoiceConnection, getVoiceConnections, joinVoiceChannel, validateDiscordOpusHead, version };
1644
+ export { AudioPlayer, type AudioPlayerBufferingState, AudioPlayerError, type AudioPlayerIdleState, type AudioPlayerPausedState, type AudioPlayerPlayingState, type AudioPlayerState, AudioPlayerStatus, AudioReceiveStream, type AudioReceiveStreamOptions, AudioResource, type ConnectionData, type ConnectionOptions, type CreateAudioPlayerOptions, type CreateAudioResourceOptions, type CreateVoiceConnectionOptions, type DiscordGatewayAdapterCreator, type DiscordGatewayAdapterImplementerMethods, type DiscordGatewayAdapterLibraryMethods, type Edge, type EndBehavior, EndBehaviorType, type JoinConfig, type JoinVoiceChannelOptions, Networking, type NetworkingClosedState, type NetworkingIdentifyingState, type NetworkingOpeningWsState, type NetworkingReadyState, type NetworkingResumingState, type NetworkingSelectingProtocolState, type NetworkingState, NetworkingStatusCode, type NetworkingUdpHandshakingState, NoSubscriberBehavior, Node, PlayerSubscription, type ProbeInfo, SSRCMap, type SocketConfig, SpeakingMap, StreamType, TransformerType, VoiceConnection, type VoiceConnectionConnectingState, type VoiceConnectionDestroyedState, VoiceConnectionDisconnectReason, type VoiceConnectionDisconnectedBaseState, type VoiceConnectionDisconnectedOtherState, type VoiceConnectionDisconnectedState, type VoiceConnectionDisconnectedWebSocketState, type VoiceConnectionReadyState, type VoiceConnectionSignallingState, type VoiceConnectionState, VoiceConnectionStatus, VoiceReceiver, VoiceUDPSocket, type VoiceUserData, VoiceWebSocket, createAudioPlayer, createAudioResource, createDefaultAudioReceiveStreamOptions, demuxProbe, entersState, generateDependencyReport, getGroups, getVoiceConnection, getVoiceConnections, joinVoiceChannel, validateDiscordOpusHead, version };
package/dist/index.js CHANGED
@@ -37,15 +37,21 @@ __export(index_exports, {
37
37
  AudioReceiveStream: () => AudioReceiveStream,
38
38
  AudioResource: () => AudioResource,
39
39
  EndBehaviorType: () => EndBehaviorType,
40
+ Networking: () => Networking,
41
+ NetworkingStatusCode: () => NetworkingStatusCode,
40
42
  NoSubscriberBehavior: () => NoSubscriberBehavior,
43
+ Node: () => Node,
41
44
  PlayerSubscription: () => PlayerSubscription,
42
45
  SSRCMap: () => SSRCMap,
43
46
  SpeakingMap: () => SpeakingMap,
44
47
  StreamType: () => StreamType,
48
+ TransformerType: () => TransformerType,
45
49
  VoiceConnection: () => VoiceConnection,
46
50
  VoiceConnectionDisconnectReason: () => VoiceConnectionDisconnectReason,
47
51
  VoiceConnectionStatus: () => VoiceConnectionStatus,
48
52
  VoiceReceiver: () => VoiceReceiver,
53
+ VoiceUDPSocket: () => VoiceUDPSocket,
54
+ VoiceWebSocket: () => VoiceWebSocket,
49
55
  createAudioPlayer: () => createAudioPlayer,
50
56
  createAudioResource: () => createAudioResource,
51
57
  createDefaultAudioReceiveStreamOptions: () => createDefaultAudioReceiveStreamOptions,
@@ -518,6 +524,16 @@ var SUPPORTED_ENCRYPTION_MODES = ["aead_xchacha20_poly1305_rtpsize"];
518
524
  if (import_node_crypto.default.getCiphers().includes("aes-256-gcm")) {
519
525
  SUPPORTED_ENCRYPTION_MODES.unshift("aead_aes256_gcm_rtpsize");
520
526
  }
527
+ var NetworkingStatusCode = /* @__PURE__ */ ((NetworkingStatusCode2) => {
528
+ NetworkingStatusCode2[NetworkingStatusCode2["OpeningWs"] = 0] = "OpeningWs";
529
+ NetworkingStatusCode2[NetworkingStatusCode2["Identifying"] = 1] = "Identifying";
530
+ NetworkingStatusCode2[NetworkingStatusCode2["UdpHandshaking"] = 2] = "UdpHandshaking";
531
+ NetworkingStatusCode2[NetworkingStatusCode2["SelectingProtocol"] = 3] = "SelectingProtocol";
532
+ NetworkingStatusCode2[NetworkingStatusCode2["Ready"] = 4] = "Ready";
533
+ NetworkingStatusCode2[NetworkingStatusCode2["Resuming"] = 5] = "Resuming";
534
+ NetworkingStatusCode2[NetworkingStatusCode2["Closed"] = 6] = "Closed";
535
+ return NetworkingStatusCode2;
536
+ })(NetworkingStatusCode || {});
521
537
  var nonce = import_node_buffer3.Buffer.alloc(24);
522
538
  function stringifyState(state) {
523
539
  return JSON.stringify({
@@ -577,13 +593,13 @@ var Networking = class extends import_node_events3.EventEmitter {
577
593
  }
578
594
  /**
579
595
  * The current state of the networking instance.
596
+ *
597
+ * @remarks
598
+ * The setter will perform clean-up operations where necessary.
580
599
  */
581
600
  get state() {
582
601
  return this._state;
583
602
  }
584
- /**
585
- * Sets a new state for the networking instance, performing clean-up operations where necessary.
586
- */
587
603
  set state(newState) {
588
604
  const oldWs = Reflect.get(this._state, "ws");
589
605
  const newWs = Reflect.get(newState, "ws");
@@ -1062,13 +1078,13 @@ var AudioPlayer = class extends import_node_events4.EventEmitter {
1062
1078
  }
1063
1079
  /**
1064
1080
  * The state that the player is in.
1081
+ *
1082
+ * @remarks
1083
+ * The setter will perform clean-up operations where necessary.
1065
1084
  */
1066
1085
  get state() {
1067
1086
  return this._state;
1068
1087
  }
1069
- /**
1070
- * Sets a new state for the player, performing clean-up operations where necessary.
1071
- */
1072
1088
  set state(newState) {
1073
1089
  const oldState = this._state;
1074
1090
  const newResource = Reflect.get(newState, "resource");
@@ -1730,13 +1746,13 @@ var VoiceConnection = class extends import_node_events7.EventEmitter {
1730
1746
  }
1731
1747
  /**
1732
1748
  * The current state of the voice connection.
1749
+ *
1750
+ * @remarks
1751
+ * The setter will perform clean-up operations where necessary.
1733
1752
  */
1734
1753
  get state() {
1735
1754
  return this._state;
1736
1755
  }
1737
- /**
1738
- * Updates the state of the voice connection, performing clean-up operations where necessary.
1739
- */
1740
1756
  set state(newState) {
1741
1757
  const oldState = this._state;
1742
1758
  const oldNetworking = Reflect.get(oldState, "networking");
@@ -2178,6 +2194,16 @@ var StreamType = /* @__PURE__ */ ((StreamType2) => {
2178
2194
  StreamType2["WebmOpus"] = "webm/opus";
2179
2195
  return StreamType2;
2180
2196
  })(StreamType || {});
2197
+ var TransformerType = /* @__PURE__ */ ((TransformerType2) => {
2198
+ TransformerType2["FFmpegOgg"] = "ffmpeg ogg";
2199
+ TransformerType2["FFmpegPCM"] = "ffmpeg pcm";
2200
+ TransformerType2["InlineVolume"] = "volume transformer";
2201
+ TransformerType2["OggOpusDemuxer"] = "ogg/opus demuxer";
2202
+ TransformerType2["OpusDecoder"] = "opus decoder";
2203
+ TransformerType2["OpusEncoder"] = "opus encoder";
2204
+ TransformerType2["WebmOpusDemuxer"] = "webm/opus demuxer";
2205
+ return TransformerType2;
2206
+ })(TransformerType || {});
2181
2207
  var Node = class {
2182
2208
  static {
2183
2209
  __name(this, "Node");
@@ -2485,7 +2511,7 @@ __name(findPackageJSON, "findPackageJSON");
2485
2511
  function version(name) {
2486
2512
  try {
2487
2513
  if (name === "@discordjs/voice") {
2488
- return "1.0.0-dev.1748174703-c1f5bb2fb";
2514
+ return "1.0.0-dev.1748347528-2c35084ec";
2489
2515
  }
2490
2516
  const pkg = findPackageJSON((0, import_node_path.dirname)(require.resolve(name)), name, 3);
2491
2517
  return pkg?.version ?? "not found";
@@ -2630,7 +2656,7 @@ async function demuxProbe(stream, probeSize = 1024, validator = validateDiscordO
2630
2656
  __name(demuxProbe, "demuxProbe");
2631
2657
 
2632
2658
  // src/index.ts
2633
- var version2 = "1.0.0-dev.1748174703-c1f5bb2fb";
2659
+ var version2 = "1.0.0-dev.1748347528-2c35084ec";
2634
2660
  // Annotate the CommonJS export names for ESM import in node:
2635
2661
  0 && (module.exports = {
2636
2662
  AudioPlayer,
@@ -2639,15 +2665,21 @@ var version2 = "1.0.0-dev.1748174703-c1f5bb2fb";
2639
2665
  AudioReceiveStream,
2640
2666
  AudioResource,
2641
2667
  EndBehaviorType,
2668
+ Networking,
2669
+ NetworkingStatusCode,
2642
2670
  NoSubscriberBehavior,
2671
+ Node,
2643
2672
  PlayerSubscription,
2644
2673
  SSRCMap,
2645
2674
  SpeakingMap,
2646
2675
  StreamType,
2676
+ TransformerType,
2647
2677
  VoiceConnection,
2648
2678
  VoiceConnectionDisconnectReason,
2649
2679
  VoiceConnectionStatus,
2650
2680
  VoiceReceiver,
2681
+ VoiceUDPSocket,
2682
+ VoiceWebSocket,
2651
2683
  createAudioPlayer,
2652
2684
  createAudioResource,
2653
2685
  createDefaultAudioReceiveStreamOptions,