The G.711 Tool can be used as a console oriented command line utility, e.g. in batch processing. The conversions run silently, without the user interface or message boxes becoming visible. Currently the following flags are supported:
Command-line | Command executed |
---|---|
G711Tool <source file> [<target>] /import | Convert raw file to corresponding wave format. |
G711Tool <source file> [<target>] /export | Convert G.711 wave file to raw format. |
G711Tool <source file> [<target>] /format:pcm | Convert G.711 wave file to pcm format. |
G711Tool <source file> [<target>] /format:alaw | Convert pcm or u-law wave file to A-law format. |
G711Tool <source file> [<target>] /format:ulaw | Convert pcm or u-law wave file to u-law format. |
After executing the relevant command the command line processor returns the user back to the operating system. Success and failure can be tracked with the DOS errorlevel parameter, which also indicates the nature of the problem:
Level | Error description |
---|---|
0 | Successful operation. |
1 | Missing source file parameter. |
11 | Memory allocation error. |
20 | File I/O error. |
21 | File I/O: Source file doesn't exist. |
23 | File I/O: Couldn't read source. |
24 | File I/O: Couldn't write target. |
31 | Unsupported source format. |
32 | Unsupported target format. |
33 | Unsupported source type. |
34 | Unsupported target type. |
35 | Same source and target formats. |
The following is a simple example demonstrating how the errorlevel exit parameter can be used to enhance user feedback in a batch processing task. The program traps an error situation where the user tries to convert a file which is already encoded in the desired format.
@echo off
rem G711 Tool: Batch processing sample
G711Tool ulaw.wav /format:ulaw
if errorlevel 35 goto error
goto exit
:error
echo *** Error: Same source and target formats.
:exit