You want to use SoX to convert the A-law input data to a more standard PCM data for LAME to process.
sox -A -c 1 -r 8000 input.8khz-mono-alaw.wav ouput.wav
Now output.wav should contain standard PCM WAV data. Run your LAME command on this (add whatever options you like):
lame output.wav output.mp3
Or, pipe the SoX output into LAME directly:
sox -A -c 1 -r 8000 input.8khz-mono-alaw.wav - | lame - output.mp3
I am making an answer out of my comment, I think it is the cause of your problem.
In your script you use
CALL "C:\Program Files (x86)\VideoLAN\VLC\vlc" -I dummy -vvv %1 --sout=#transcode{vcodec="h264", vb="512", fps="23.97", scale="1", acodec="mpga",ab="128","channels=2",samplerate="44100"}:standard{access="file",mux="dummy",dst="%_commanm%.mp4"} vlc://quit
and the error shows
main stream output error: stream chain failed for `transcode{vcodec=h264,'
this leads me to the conclusion that the parser cuts at every whitespace (space, tab etc) and thus cannot understand the command. In the link to the VLC wiki there are no whitespaces as well.
try this line:
CALL "C:\Program Files (x86)\VideoLAN\VLC\vlc" -I dummy -vvv %1 --sout=#transcode{vcodec="h264",vb="512",fps="23.97",scale="1",acodec="mpga",ab="128","channels=2",samplerate="44100"}:standard{access="file",mux="dummy",dst="%_commanm%.mp4"} vlc://quit
Why can't vlc cope with those stupid whitespace you might ask? (actually you do ;) )
When a programm is called to be executed by the OS - I only know this for linux for sure, but I am pretty sure windows handles it very similar - the parameters to the command are split by the operating system (at the spaces) and then handed to the program as a list, each containing only the content between the spaces.
So it would be the programs task to recognize and read all the individual entries in that list and glue them together again, this is indeed possible but costs time, both when developing the software and when evaluating the parameters.
Best Answer
FFMpeg can't write on the same file while reading from it because it can cause errors.
The only way to do it is to convert into another file and replace the original files.
Or you can convert it to another folder and replace the original folder, it's easier.
For Windows:
Note: Replace %i with %%i when putting it in Windows batch file.
For Linux:
Now just replace your directory with outdir.
For your case:
If you want it for Counter Strike:GO or HLDJ, then look here. HL requires more settings,
audio must be mono (add
-ac 1
flag in FFMpeg) and 16-bit (add-acodec pcm_s16le
).So your FFMpeg command (on Linux) will look like this: