lib/discordrb/voice/encoder.rb
# @return [IO] the audio, encoded as s16le PCM
def encode_file(file, options = '')
command = "#{ffmpeg_command} -loglevel 0 -i \"#{file}\" #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1"
IO.popen(command)
end
This string construction which depends on library input is later used in a shell command.
Path with 2 steps
-
lib/discordrb/voice/encoder.rb
# @param options [String] ffmpeg options to pass after the -i flag # @return [IO] the audio, encoded as s16le PCM def encode_file(file, options = '') command = "#{ffmpeg_command} -loglevel 0 -i \"#{file}\" #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1" IO.popen(command)
-
lib/discordrb/voice/encoder.rb
# @return [IO] the audio, encoded as s16le PCM def encode_file(file, options = '') command = "#{ffmpeg_command} -loglevel 0 -i \"#{file}\" #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1" IO.popen(command) end
lib/discordrb/voice/encoder.rb
# @return [IO] the audio, encoded as s16le PCM
def encode_file(file, options = '')
command = "#{ffmpeg_command} -loglevel 0 -i \"#{file}\" #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1"
IO.popen(command)
end
This string construction which depends on library input is later used in a shell command.
Path with 2 steps
-
lib/discordrb/voice/encoder.rb
# @param options [String] ffmpeg options to pass after the -i flag # @return [IO] the audio, encoded as s16le PCM def encode_file(file, options = '') command = "#{ffmpeg_command} -loglevel 0 -i \"#{file}\" #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1" IO.popen(command)
-
lib/discordrb/voice/encoder.rb
# @return [IO] the audio, encoded as s16le PCM def encode_file(file, options = '') command = "#{ffmpeg_command} -loglevel 0 -i \"#{file}\" #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1" IO.popen(command) end