Sha256: cdc42671da864ee36eceb6f5ad1d259d616dc4d4719c90199a121cdf222f37f5

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

require "discorb"
begin
  require "rbnacl"
rescue LoadError
  raise LoadError, <<~EOS, cause: nil
                             Could not load libsodium library.
                             Follow the instructions at https://github.com/discorb-lib/discorb-voice#install-libsodium
                           EOS
end
require "open3"
begin
  ffmpeg_version = Open3.capture2e("ffmpeg -version")[0]
rescue Errno::ENOENT
  raise LoadError, <<~EOS, cause: nil
                             Could not find ffmpeg.
                             Follow the instructions at https://github.com/discorb-lib/discorb-voice#install-ffmpeg
                           EOS
else
  line = ffmpeg_version.split("\n").find { |line| line.start_with?("configuration: ") }
  unless line.include? "--enable-libopus"
    raise LoadError, <<~EOS, cause: nil
                               Your ffmpeg version does not support opus.
                               Install ffmpeg with opus support.
                             EOS
  end
end
require_relative "voice/version"
require_relative "voice/extend"
require_relative "voice/core"
require_relative "voice/ogg"
require_relative "voice/source"

module Discorb
  module Voice
    class Error < StandardError; end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
discorb-voice-0.1.0 lib/discorb/voice.rb