Skip to content

Commit

Permalink
Fix io returned by encode_io doesnt emit EOFError when readpartial
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaa777 authored and swarley committed Aug 17, 2020
1 parent c12fb85 commit 03410e9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/discordrb/voice/encoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ def encode_file(file, options = '')
# @param options [String] ffmpeg options to pass after the -i flag
# @return [IO] the audio, encoded as s16le PCM
def encode_io(io, options = '')
ret_io, writer = IO.pipe
command = "#{ffmpeg_command} -loglevel 0 -i - #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1"
spawn(command, in: io, out: writer)
ret_io
IO.popen(command, in: io)
end

private
Expand Down

0 comments on commit 03410e9

Please sign in to comment.