<commit_before>require 'opus-ruby'

# Discord voice chat support
module Discordrb::Voice
  # Wrapper class around opus-ruby
  class Encoder
    def initialize
      @sample_rate = 48_000
      @frame_size = 960
      @channels = 2
      @opus = Opus::Encoder.new(@sample_rate, @frame_size, @channels)
    end

    def encode(buffer)
      @opus.encode(buffer, 1920)
    end

    def destroy
      @opus.destroy
    end

    def encode_file(file)
      command = "ffmpeg -i #{file.path} -f s16le -ar 48000 -ac 2 -af volume=1 pipe:1"
      IO.popen(command)
    end
  end
end<commit_msg>Prevent ffmpeg from outputting its log data<commit_after>require 'opus-ruby'

# Discord voice chat support
module Discordrb::Voice
  # Wrapper class around opus-ruby
  class Encoder
    def initialize
      @sample_rate = 48_000
      @frame_size = 960
      @channels = 2
      @opus = Opus::Encoder.new(@sample_rate, @frame_size, @channels)
    end

    def encode(buffer)
      @opus.encode(buffer, 1920)
    end

    def destroy
      @opus.destroy
    end

    def encode_file(file)
      command = "ffmpeg -loglevel 0 -i #{file.path} -f s16le -ar 48000 -ac 2 -af volume=1 pipe:1"
      IO.popen(command)
    end
  end
end
{'fraction_non_alphanumeric': 0.09488448844884488, 'fraction_numerical': 0.038778877887788776, 'mean_word_length': 2.6101190476190474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4529055', 'n_tokens_mistral': 464, 'n_tokens_neox': 408, 'n_words': 117}