G.711 Tool: Command-line syntax

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-lineCommand 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:ulawConvert pcm or u-law wave file to u-law format.

Errorlevel feadback

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:

LevelError description
  0Successful operation.
  1Missing source file parameter.
 11Memory allocation error.
 20File I/O error.
 21File I/O: Source file doesn't exist.
 23File I/O: Couldn't read source.
 24File I/O: Couldn't write target.
 31Unsupported source format.
 32Unsupported target format.
 33Unsupported source type.
 34Unsupported target type.
 35Same source and target formats.

Batch processing sample

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

echo *** Error: Same source and target formats.