fix: sending audio flag
This commit is contained in:
@@ -82,7 +82,7 @@ class VoiceConnection extends EventEmitter {
|
|||||||
* The audio player for this voice connection
|
* The audio player for this voice connection
|
||||||
* @type {MediaPlayer}
|
* @type {MediaPlayer}
|
||||||
*/
|
*/
|
||||||
this.player = new MediaPlayer(this);
|
this.player = new MediaPlayer(this, this.constructor.name === 'StreamConnection');
|
||||||
|
|
||||||
this.player.on('debug', m => {
|
this.player.on('debug', m => {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ class BaseDispatcher extends Writable {
|
|||||||
* @event BaseDispatcher#debug
|
* @event BaseDispatcher#debug
|
||||||
* @param {string} info The debug info
|
* @param {string} info The debug info
|
||||||
*/
|
*/
|
||||||
this._setSpeaking(1);
|
this._setSpeaking(this.player.isScreenSharing ? 1 << 1 : 1 << 0); // 1 << 0 = SPEAKING, 1 << 1 = SOUND SHARE
|
||||||
if (!this.player.voiceConnection.sockets.udp) {
|
if (!this.player.voiceConnection.sockets.udp) {
|
||||||
this.emit('debug', 'Failed to send a packet - no UDP socket');
|
this.emit('debug', 'Failed to send a packet - no UDP socket');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const FFMPEG_ARGUMENTS = ['-analyzeduration', '0', '-loglevel', '0', '-f', 's16l
|
|||||||
* @extends {EventEmitter}
|
* @extends {EventEmitter}
|
||||||
*/
|
*/
|
||||||
class MediaPlayer extends EventEmitter {
|
class MediaPlayer extends EventEmitter {
|
||||||
constructor(voiceConnection) {
|
constructor(voiceConnection, isScreenSharing) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.dispatcher = null;
|
this.dispatcher = null;
|
||||||
@@ -45,6 +45,8 @@ class MediaPlayer extends EventEmitter {
|
|||||||
* @type {VoiceConnection}
|
* @type {VoiceConnection}
|
||||||
*/
|
*/
|
||||||
this.voiceConnection = voiceConnection;
|
this.voiceConnection = voiceConnection;
|
||||||
|
|
||||||
|
this.isScreenSharing = isScreenSharing;
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
|
|||||||
Reference in New Issue
Block a user