Closed tnt closed 3 years ago
Hello,
if you don't specify the output file format explicitly, then DynamicAudioNormalizer will try to guess the format from the file name. The default output format for "piped" output is raw PCM format, as that is the common way to pass audio data over a pipe.
LAME needs extra options for this. Please see the section Input options for raw PCM here: https://svn.code.sf.net/p/lame/svn/trunk/lame/USAGE
Note that sending WAVE files over a pipe is not really possible, because WAVE is a file-based format. A WAVE file is composed of so-called "chunks" and each chunk begins with a header containing the type and the total size of the chunk. Obviously, when writing out the WAVE header, you cannot know the final total size yet! This is solved in practice by writing a fake/dummy (placeholder) WAVE header first, then writing all the data, and, at the very the end - when the total size is known - seek back to the beginning of the file and overwrite the fake/dummy header with the actual WAVE header. Obviously, you cannot do this with a pipe 😏
The AU format, for example, is suitable for streaming over a pipe. But I don't know whether LAME can read that (from a pipe).
Regards MuldeR
BTW, encoding with LAME is possible via FFmpeg:
DynamicAudioNormalizerCLI.exe -i "input.wav" -o - |
ffmpeg.exe -loglevel quiet -f s16le -ar 44100 -ac 2 -i - -c:a libmp3lame -qscale:a 2 "output.mp3"
Thanks for the thorough explanation. That file size thing makes it of course impossible. So it looks I'll actually have to put up with ffmpeg. Thank you!
I don't know how hard or easy this would be to implement - I suppose it's not quite extensive.
I have asked a question on Stackoverflow regarding this issue.
When I just want to directly pipe the output into e.g. lame the file-format would convey lots of information about the audio data like sampling frequency, etc. that are not in the stdout stream so that I not only had to set lots of options but of course first had to figure out these details which makes it quite inconvenient.
When executing
I get the error
Maybe it would work with another format but - as far as I can see - it is not documented which formats the
--output-fmt
option accepts.From the mentioned Stackoverflow question:
When I do essentially the same but direct the output of the normalizer to a file and then
cat
the file into lame it works.