Is it possible by command line to join more FLAC files on decoding process and write to stdout?
sox file1.flac file2.flac ..... fileN.flac -t wav -
For something like this using Foobar's converter is much easier. Avisynth is even another option, but it can be done by command line:
ffmpeg.exe -i track1.flac -i track2.flac -i track3.flac ... -i trackN.flac -filter_complex "[0:0][1:0][2:0][3:0][4:0][5:0][6:0][7:0]concat=n=8:v=0:a=1" -f wav - | Takc.exe -e -pMax -ihs - album.tak
ffmpeg.exe -i "concat:track1.flac|track2.flac|track3.flac|...|trackN.flac" -f wav - | Takc.exe -e -pMax -ihs - album.tak
or as phofman has pointed out...
sox.exe track1.flac track2.flac track3.flac ... trackN.flac -t wav - | Takc.exe -e -pMax - album.tak
Note that for transcoding to Opus, for ffmpeg you'd need
-f s16le instead of
-f wav and for sox you'd need
-t raw instead of
-t wav.
For something like this using Foobar's converter is much easier.
Easier is a relative term. I am done with the task using CLI tools before foobar even starts up Of course it requires a decent shell of which cmd is not a good example.
I'm a Linux user. I would be able to get something like this:
flac -cd track1.flac track2.flac track3.flac | lame - joined_tracks.mp3
I'm a Linux user. I would be able to get something like this:
flac -cd track1.flac track2.flac track3.flac | lame - joined_tracks.mp3
You have been already given two ways - sox, ffmpeg
sox track1.flac track2.flac track3.flac -t wav - | lame - joined_tracks.mp3
What is wrong with that?
I looked at an old script to see how do it. I decoded to PCM, concatenated and reencoded. I would have used Sox had I thought to try.
I'm looking for a Linux script to decode and concatenate on fly without using extra software as SOX or FFmpeg.
SOX and FFmpeg are valid tools but I'd like to harness the Linux script power.
You've been offered two nice power lawn mowers and you decide you can't even use a push mower.
Enjoy watching your grass grow, I guess.
SOX and FFmpeg are valid tools but I'd like to harness the Linux script power.
Well then I am afraid it is time for your to learn the linux script power yourself, not ask others to do it for you :-)
I'm a Linux user. I would be able to get something like this:
flac -cd track1.flac track2.flac track3.flac | lame - joined_tracks.mp3
Interesting. I didn't know flac.exe accepts multiple inputs just like sox.exe. BUT unlike sox and ffmpeg, with flac's (piped) output you can hear a nasty click on each transition. Maybe I'm forgetting something, I don't know.
Btw, lame.exe needs
-r (raw input) to handle flac's output.
BUT unlike sox and ffmpeg, with flac's (piped) output you can hear a nasty click on each transition.
That sounds like it's outputting wav headers. Add --force-raw-format to the command line.
I'm looking for a Linux script to decode and concatenate on fly without using extra software as SOX or FFmpeg.
SOX and FFmpeg are valid tools but I'd like to harness the Linux script power.
Harnessing the power of the Windows command shell, I came up with this:
for %%i in (*.flac) do flac -d "%%i" --endian=little --sign=signed --force-raw-format -c >> merged.raw
lame -r --signed --little-endian merged.raw merged.mp3
del merged.raw
I guess you can do something less verbose (avoid the tempfile) in Linux bash/csh/whatever and also Windows cmd/Powershell, but that is pretty straightforward.
I'm a Linux user. I would be able to get something like this:
flac -cd track1.flac track2.flac track3.flac | lame - joined_tracks.mp3
flac -d -c --force-raw-format --endian=little --sign=signed *.flac | lame -r --signed --little-endian --preset standard - joined_tracks.mp3
Perhaps a bit off-topic, but what about TAK? Takc.exe doesn't accept flac's output that way.
flac -d -c --force-raw-format --endian=little --sign=signed *.flac | lame -r --signed --little-endian --preset standard - joined_tracks.mp3
Sometimes I hate that Windows cmd doesn't expand the wildcard operator... Time to use Powershell.
Perhaps a bit off-topic, but what about TAK? Takc.exe doesn't accept flac's output that way.
You could use SoX (http://www.hydrogenaudio.org/forums/index.php?showtopic=102645&view=findpost&p=844857) to add a WAV header to that raw output stream, since Takc apparently doesn't accept raw input. Isn't it fun running in circles (http://www.hydrogenaudio.org/forums/index.php?showtopic=102645&view=findpost&p=844857)?
That's why I much prefer Foobar for this task!
flac -d -c --force-raw-format --endian=little --sign=signed *.flac | lame -r --signed --little-endian --preset standard - joined_tracks.mp3
Sometimes I hate that Windows cmd doesn't expand the wildcard operator... Time to use Powershell.
Although cmd doesn't expand wildcard, flac 1.3.0 will expand it for you.
That's the side effect of new flac using __wgetmainargs() function, in order to support Unicode pathnames on Windows.
flac -d -c --force-raw-format --endian=little --sign=signed *.flac | lame -r --signed --little-endian --preset standard - joined_tracks.mp3
This is wonderful, it works!
I tried this and it works also:
flac -cd --force-raw-format --endian=little --sign=signed track1.flac track2.flac track3.flac | lame -r --signed --little-endian --preset standard - joined_tracks.mp3
Thanks!