def play_dca(file)
      stop_playing(true) if @playing

      @bot.debug "Reading DCA file #{file}"
      input_stream = File.open(file)

      magic = input_stream.read(4)
      raise ArgumentError, 'Not a DCA1 file! The file might have been corrupted, please recreate it.' unless magic == 'DCA1'

      # Read the metadata header, then read the metadata and discard it as we don't care about it
      metadata_header = input_stream.read(4).unpack1('l<')
      input_stream.read(metadata_header)

      # Play the data, without re-encoding it to opus
      play_internal do
        begin
          # Read header
          header_str = input_stream.read(2)

          unless header_str
            @bot.debug 'Finished DCA parsing (header is nil)'
            next :stop
          end

          header = header_str.unpack1('s<')

          raise 'Negative header in DCA file! Your file is likely corrupted.' if header.negative?
        rescue EOFError
          @bot.debug 'Finished DCA parsing (EOFError)'
          next :stop
        end

        # Read bytes
        input_stream.read(header)
      end
    end
def play_dca(file)
      stop_playing(true) if @playing

      @bot.debug "Reading DCA file #{file}"
      input_stream = File.open(file)

      magic = input_stream.read(4)
      raise ArgumentError, 'Not a DCA1 file! The file might have been corrupted, please recreate it.' unless magic == 'DCA1'

      # Read the metadata header, then read the metadata and discard it as we don't care about it
      metadata_header = input_stream.read(4).unpack1('l<')
      input_stream.read(metadata_header)

      # Play the data, without re-encoding it to opus
      play_internal do
        begin
          # Read header
          header_str = input_stream.read(2)

          unless header_str
            @bot.debug 'Finished DCA parsing (header is nil)'
            next :stop
          end

          header = header_str.unpack1('s<')

          raise 'Negative header in DCA file! Your file is likely corrupted.' if header.negative?
        rescue EOFError
          @bot.debug 'Finished DCA parsing (EOFError)'
          next :stop
        end

        # Read bytes
        input_stream.read(header)
      end
    end
Plays a stream of audio data in the DCA format. This format has the advantage that no recoding has to be
 done - the file contains the data exactly as Discord needs it.
 @note DCA playback will not be affected by the volume modifier ({#volume}) because the modifier operates on raw
   PCM, not opus data. Modifying the volume of DCA data would involve decoding it, multiplying the samples and
   re-encoding it, which defeats its entire purpose (no recoding).
 @see https://github.com/bwmarrin/dca
 @see #play