stopPlaying() {
        if(this.ended) {
            return;
        }
        this.ended = true;
        if(this.current && this.current.timeout) {
            clearTimeout(this.current.timeout);
            this.current.timeout = null;
        }
        this.current = null;
        if(this.piper) {
            this.piper.stop();
            this.piper.resetPackets();
        }

        if(this.secret) {
            for(let i = 0; i < 5; i++) {
                this.timestamp += this.frameSize;
                if(this.timestamp >= 4294967295) {
                    this.timestamp -= 4294967295;
                }

                if(++this.sequence >= 65536) {
                    this.sequence -= 65536;
                }

                this._sendPacket(this._createPacket(Buffer.from([0xF8, 0xFF, 0xFE])));
            }
        }
        this.setSpeaking(this.playing = false);

        /**
        * Fired when the voice connection finishes playing a stream
        * @event VoiceConnection#end
        */
        this.emit("end");
    }
/**
    * Stop the bot from sending audio
    */
Stop the bot from sending audio
Stop the bot from sending audio
stopPlaying() {
        if(this.ended) {
            return;
        }
        this.ended = true;
        if(this.current && this.current.timeout) {
            clearTimeout(this.current.timeout);
            this.current.timeout = null;
        }
        this.current = null;
        if(this.piper) {
            this.piper.stop();
            this.piper.resetPackets();
        }
        if(this.secret) {
            for(let i = 0; i < 5; i++) {
                this.timestamp += this.frameSize;
                if(this.timestamp >= 4294967295) {
                    this.timestamp -= 4294967295;
                }
                if(++this.sequence >= 65536) {
                    this.sequence -= 65536;
                }
                this._sendPacket(this._createPacket(Buffer.from([0xF8, 0xFF, 0xFE])));
            }
        }
        this.setSpeaking(this.playing = false);
        this.emit("end");
    }
stopPlaying ( ) { if ( this . ended ) { return ; } this . ended = true ; if ( this . current && this . current . timeout ) { clearTimeout ( this . current . timeout ) ; this . current . timeout = null ; } this . current = null ; if ( this . piper ) { this . piper . stop ( ) ; this . piper . resetPackets ( ) ; } if ( this . secret ) { for ( let i = 0 ; i < 5 ; i ++ ) { this . timestamp += this . frameSize ; if ( this . timestamp >= 4294967295 ) { this . timestamp -= 4294967295 ; } if ( ++ this . sequence >= 65536 ) { this . sequence -= 65536 ; } this . _sendPacket ( this . _createPacket ( Buffer . from ( [ 0xF8 , 0xFF , 0xFE ] ) ) ) ; } } this . setSpeaking ( this . playing = false ) ; this . emit ( "end" ) ; }
Stop the bot from sending audio
Stop the bot from sending audio
/**
        * Fired when the voice connection finishes playing a stream
        * @event VoiceConnection#end
        */