I'm making a simple script in Ruby to convert FLAC to MP3 in batches, sending the decoded FLAC to stdout (to avoid temporary files):
flac.exe -d -c in.flac | lame.exe - out.mp3
In Ruby I can easily run the command with the "system" function or with the pipeline method:
cmd1 = 'flac.exe -d -c in.flac'cmd2 = 'lame.exe - out.mp3'process = Open3.pipeline(cmd1, cmd2)
The problem is that, despite converting everything perfectly, during the conversion LAME doesn't show anything on the screen. Only the output of the FLAC decoder is shown, but the LAME histogram along with all its statistics are not shown.
flac 1.4.3Copyright (C) 2000-2009 Josh Coalson, 2011-2023 Xiph.Org Foundationflac comes with ABSOLUTELY NO WARRANTY. This is free software, and you arewelcome to redistribute it under certain conditions. Type `flac' for detailsin.flac: 65% complete
If I set the --silent option to FLAC, it just suppresses the printout, but LAME still doesn't output anything. I read that if you set the output of LAME to '-', it will send everything to stdout:
flac.exe -d -c in.flac | lame.exe - - > out.mp3
But I still can't get LAME's stats to display.Any help? preferably cross-platform (although I mostly use Windows). Regards.