Taperssection.com

Gear / Technical Help => Post-Processing, Computer / Streaming / Internet Devices & Related Activity => Topic started by: admkrk on February 20, 2017, 02:05:03 PM

Title: FLAC Commandline Question
Post by: admkrk on February 20, 2017, 02:05:03 PM
I am probably overlooking something really simple, but...

flac *.wav outputs to the same directory, but I want to redirect the output to a different directory. The -o switch will do that, but it seems to only work on one file at a time. "Just use TLH" is not the solution I am looking for, before anyone suggests that.

Thanks
Title: Re: FLAC Commandline Question
Post by: morst on February 20, 2017, 02:37:49 PM
I have never used it from the command line but the man page suggests this option?
https://linux.die.net/man/1/flac
Quote
--output-prefix=string
Prefix each output file name with the given string. This can be useful for encoding or decoding files to a different directory. Make sure if your string is a path name that it ends with a trailing '/' (slash).
Title: Re: FLAC Commandline Question
Post by: admkrk on February 20, 2017, 04:17:35 PM
Thanks, not sure how I missed that, and it sounds like it should work. Unfortunately it is erroring out for me on the first file
Quote
devon2016-04-14t01.wav: ERROR initializing encoder
                        init_status = FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_E
RROR
                        state = FLAC__STREAM_ENCODER_IO_ERROR

An error occurred opening the output file; it is likely that the output
directory does not exist or is not writable, the output file already exists and
is not writable, or the disk is full.
I am going to have to look up the error code to get a better idea of what the problem is, because the suggestions are not true.

I have never used it from the command line but the man page suggests this option?
https://linux.die.net/man/1/flac
Quote
--output-prefix=string
Prefix each output file name with the given string. This can be useful for encoding or decoding files to a different directory. Make sure if your string is a path name that it ends with a trailing '/' (slash).
Title: Re: FLAC Commandline Question
Post by: morst on February 20, 2017, 05:15:37 PM
Did you create the new directory first? And the target drive is not full?

An error occurred opening the output file; it is likely that the output directory does not exist or is not writable, the output file already exists and
is not writable, or the disk is full.
Title: Re: FLAC Commandline Question
Post by: admkrk on February 20, 2017, 05:47:24 PM
Yes. It worked with
Quote
flac -o H:\temp\temp\devon2016-04-14t01.flac H:\temp\devon2016-04-14t01.wav
But I get the error with
Quote
flac H:\temp\*.wav --output-prefix=H:\temp\temp/
I tried with the trailing slash the other way, and without it. Putting the switch before the source did not work either.

And yes, I deleted first converted file before trying it. I just tried again with the -o switch and the wildcard, both worked as expected.


Did you create the new directory first? And the target drive is not full?

An error occurred opening the output file; it is likely that the output directory does not exist or is not writable, the output file already exists and
is not writable, or the disk is full.
Title: Re: FLAC Commandline Question
Post by: Gordon on February 20, 2017, 08:34:02 PM
If on windows why not use traders little helper?
Title: Re: FLAC Commandline Question
Post by: admkrk on February 20, 2017, 09:34:19 PM
The purpose of the project I am working on is to develop a front end to FLAC, or in other words, it is a programming project. This is an exercise, for me, to learn how to do something I have not done before, or at least not well (I made a simple IDE, for a school project, but it had problems). I could always move the files, after they are created, but that does not seem very efficient, if I can get FLAC to just do it originally. Looping through the -o switch would be better, but not by much. Because I have always used programs like TLH and Flacfrontend, I am not familiar with the command line arguments.   

If on windows why not use traders little helper?
Title: Re: FLAC Commandline Question
Post by: Gordon on February 20, 2017, 11:08:31 PM
"Just use TLH" is not the solution I am looking for, before anyone suggests that.

Thanks

Sorry missed that or I wouldn't have posted that ;)
Title: Re: FLAC Commandline Question
Post by: admkrk on February 21, 2017, 01:15:14 AM
No worries, I said that in order to avoid typing out my last response.  :banging head: :cheers:

Title: Re: FLAC Commandline Question
Post by: morst on February 21, 2017, 01:51:12 PM
No worries, I said that in order to avoid typing out my last response.  :banging head: :cheers:
But you don't mind typing in a whole program to be a UI where they already exist?
 :-\
Title: Re: FLAC Commandline Question
Post by: admkrk on February 21, 2017, 03:56:49 PM
Explaining my intent is not relevant to the question, and I am still looking for an answer. A short sentence stating I was aware of existing programs was cleaner than writing a whole paragraph of explanation. I also do not write code like this:
Code: [Select]
// Add a and b, then store the result in c
c = a + b;