Log in

View Full Version : Piping audio from one application to another


Floatingshed
12th February 2012, 22:51
I want to extract audio from a .avs, pipe it into sox and then pipe it to nero to encode aac.

I have been doing this in 3 stages (in one .bat file) with wavi, sox and nero by using temporary files but I'd like to tidy it up. Please help.

I have no knowledge of piping whatsoever so please be gentle with me...

b66pak
13th February 2012, 05:41
post your .bat file, please...
_

sneaker_ger
13th February 2012, 10:24
Try something like this:
avs2pipemod -wav input.avs | sox --ignore-length -t wav - -t wav - | neroaacenc -ignorelength -if - -of output.m4a

I use avs2pipemod instead of wavi, but figuring out the corresponding wavi parameters should be easy.

Floatingshed
13th February 2012, 11:28
post your .bat file, please...
_


for %%i in (*.avs) do (


"c:\program files\tools\Wavi" "%~1%%i" "temp\%~1%%~ni.wav"

"C:\program files\tools\sox.exe" "temp\%~1%%~ni.wav" "%~1%%~ni.wav" compand 0.3,1 6:-60,-50,-30 -14 -90 0.2 gain -n -1

"c:\program files\tools\neroAacEnc.exe" -lc -q 65.0 -if "%~1%%~ni.wav" -of "%~1%%~ni.m4a"


)

pause

sneaker_ger
13th February 2012, 11:55
for %%i in (*.avs) do (


"c:\program files\tools\Wavi" "%~1%%i" - | "C:\program files\tools\sox.exe" --ignore-length -t wav - -t wav - compand 0.3,1 6:-60,-50,-30 -14 -90 0.2 gain -n -1 | "c:\program files\tools\neroAacEnc.exe" -ignorelength -lc -q 65.0 -if - -of "%~1%%~ni.m4a"


)

pause

This should work, but note that "gain -n -1" will require SoX to write a temporary file nonetheless.

Floatingshed
13th February 2012, 15:25
Works beautifully, thanks.
Where does sox put its temp file, does it get automatically deleted?

tebasuna51
13th February 2012, 15:26
Remember:
neroAacEnc.exe [options] -if <input-file> -of <output-file>
Where:
-q <number> : Enables "target quality" mode.
<number> is a floating-point number in 0...1 range.

EDIT: about temp file using sox 14.3.2
−−temp DIRECTORY
Specify that anytemporary files should be created in the given DIRECTORY.This can be useful if
there are permission or free-space problems with the default location. In this case, using ‘−−temp .’
(to use the current directory) is often a good solution.

I don't know where is now the default location. A old version use \tmp directory in local drive.

Floatingshed
13th February 2012, 17:15
Remember:
neroAacEnc.exe [options] -if <input-file> -of <output-file>
Where:
-q <number> : Enables "target quality" mode.
<number> is a floating-point number in 0...1 range.




Oops, well spotted thank you. Of course I meant to type 0.65!

Floatingshed
13th February 2012, 19:12
Just for fun I tried it with avs2pipemod and got a missing RIFF header error...