Manual.txt for Version 1.50 of ISO/MPEG Audio Layer 3 software only encoder/decoder for PCs. 1. ENCODER V1.00 ============= L3ENC.EXE is an ISO/MPEG Layer III software only encoder. It takes PCM audio data files as input and delivers Layer III coded bit stream files as output. Several options can be selected via command line switches. Usage: L3ENC [-switch1 [-switch2 [...]]] L3ENC.EXE should work on any IBM PC compatible computer with a 386 type CPU or better with external or built in 387 hardware floating point support. A 486DX CPU or better is recommended. L3ENC uses one of the Dos extenders EMX.EXE or RSX.EXE supplied together with this shareware package. EMX.EXE is used for Dos Real Mode and RSX.EXE is used for V86 Mode (e.g. Dos Box under Windows). L3ENC automatically loads the appropriate extender when started. In order to find the extender, L3ENC needs emx.exe and rsx.exe in the same directory or the environment variables EMX and RSX. If you place emx.exe or rsx.exe not in the same directory as l3enc.exe please execute the commands: SET EMX=C:\PATH\EMX.EXE SET RSX=C:\PATH\RSX.EXE where "C:\PATH\" shows the directory where EMX.EXE and RSX.EXE can be found. EMX.EXE is copyright by Eberhard Mattes and RTX.EXE is copyright by Rainer Schnither. Please read the documentation supplied with the dos extenders for details. 1.1 PCM audio input file The first command line argument specifies the name for the PCM audio data file. Version 1.00 of the encoder accepts either raw PCM audio data files or PCM audio data files in RIFF/WAVE format as used by Microsoft Windows. The samples must be 16 bit signed integer values. The sampling rate must be 44.1 kHz. A) raw PCM audio data By default the input file is assumed to contain raw PCM audio data. Stereo audio data is input in interleaved format, the first channel beeing the left channel. ... Mono audio data has the format .... Whether the input file is treated as mono or stereo audio data is set by the encoding mode parameter (1.3). Default is stereo. B) RIFF/WAVE format If the '-wav' option is specified, the input file is assumed to contain 16 bit PCM audio data in RIFF/WAVE format as used by Microsoft Windows. Audio parameters are extracted from the Wave header and checked against the settings of the encoder. If not supported options are found (e.g. 8 bits/sample), the encoding process is aborted. The encoding mode (mono or stereo) is determined by the settings in the WAVE header. 1.2 bitstream output file The second command line argument specifies the name for the bitstream output file. As for now there is no default value for the filename or for the extension of the file name. The format of the bit stream is as defined in the ISO/MPEG publication IS11172-3. 1.3 encoding mode Depending on the setting of the '-mod' switch, the encoder will treat the two input channels as: -mod 1 stereo (joint stereo), -mod 2 mono audio data. Default is joint stereo. For stereo, the first channel is the left channel. The second channel is the right channel. If input files in WAVE format are used, the encoding mode is determined by the settings in the Wave header. 1.4 sampling rate Version 1.00 of the encoder is still restricted to 44.1 kHz. Look for support of 32kHz, 44.1 kHz and 48 kHz in the near future. 1.5 bitrate The bitrate of the bit stream output is selected via the '-br' switch. The bitrate is specified in bits/second. The bitrate is the total bitrate for all encoded channels, i.e. if you select 'br 128000' and 'stereo', both channels will be stuffed into one bit stream of 128000 bits/second. Currently only ISO bit rates are accepted by the encoder. Valid bit rates are: 32k 40k 48k 56k 64k 80k 96k 112k 128k 160k 192k 224k 256k 320k The default bitrate is 128000 bits/sec. Version 1.00 of the encoder is restricted to stereo bit rates greater than 64 kBit/s and to mono bit rates less than 320 kBit/s. 1.6 crc check If '-crc' is asserted, ISO/MPEG1 crc checking is enabled. Without the 'crc' switch, crc checking is disabled. 1.7 swap low and high byte of input samples If the '-tfs' option is specified, the low and high bytes of each audio data input sample are swapped. Use '-tfs' if you move your PCM audio data from little endian to big endian machines (or vice versa). 1.8 examples of switch settings L3ENC infile.pcm out.bit -br 112000 -cr L3ENC c:\music\pcm\newage.pcm c:\bitstr\l3\newage.bit -mod 2 -br 64000 L3ENC pop.wav -wav -br 96000 2. DECODER V2.00 ============= L3DEC.EXE is an ISO/MPEG Layer 3 software only decoder. It takes Layer 3 bit stream files as input and delivers PCM audio data files as output. A number of options can be selected via command line switches. Usage: l3dec [] [-switch1 [switch2 [...]]] L3DEC.EXE should work on any IBM PC compatible computer with a 386 CPU or better with external or built in 387 hardware floating point support. If you specify no output file name, the bit stream is nevertheless (partially) decoded but PCM audio output is discarded. This option is only useful, if you want to check the correct format of a a bit stream file without actually producing any output. And yes --- this is much faster than the full decoding process. 2.1 bit stream input file The format of the bit stream input file must comply with ISO/IEC IS11172-3. Currently there is no default file name extension. The decoder will process all valid MPEG1 Layer3 bit stream data without restrictions to bit rate or sampling frequency. It supports also MPEG2 Layer 3 low sampling frequencies. 2.2 PCM audio data output file Audio data is output as samples of 16 bit signed integer PCM data. The default format is raw PCM data and can be either one channel or two interleaved channels. format of one (mono) channel PCM audio data: .... format of two channel (stereo) PCM audio data: ... If one or two audio channels are used depends on the encoded information in the bit stream. For stereo output data the first channel is the left channel. Information about sampling frequency and number of used channels is displayed at the beginning of the decoding process. 2.3 RIFF/WAVE format If selected by the '-wav' switch, audio data is output in RIFF/WAVE format (*.WAV) as used by Microsoft Windows. The audio data itself is still written as 16 bit PCM data as described in 2.2 but it is preceded by a WAVE-header. The WAVE-Header contains information about the number of channels (1 or 2), sampling frequency (32k/44.1k/48k) and used bits per sample (16). 2.4 SND format If selected by the '-snd' switch, audio data files are output in the SND format used on SUN and NeXT-Workstations. 2.5 AIFF format If selected by the '-aif' switch, audio data files are output in the AIFF format. 2.6 skip frames With the '-fb' option you can skip a number of frames in the bit stream before the decoding starts. '-fb nnn' skips the first nnn frames. Each frame contains 1152 samples of audio data. Depending on the used sampling frequency, the duration of a frame is calculated as 24 msec (@ 48kHz), 26.1 msec (@ 44.1kHz) or 36 msec (@ 32kHz). 2.7 decode only nnn frames If you want to decode only a certain number of frames, specify the '-fn' option. '-fn xxx' will decode only xxx frames (see also 2.6). 2.8 search again after loss of synchronisation Normally the decoding process is stopped, if a loss of synchronisation is detected, i.e. the synch information is incorrect. To enable decoding of partially damaged bit stream files, you may assert the '-sa' option. In this mode the decoding is not stopped and the file is searched for valid synch information until end of file is encountered. 2.9 write audio data as ascii hex 24bit output file If the option '-h24 xxx' is specified an (additional) output file with name 'xxx' is opened. PCM Audio data is output as 24 bit ascii hex values followed by carriage return and line feed. Accuracy of the output values is 24 bit compared to the 16 bits raw output mode. Files output in 'h24' format take four times the storage capacity necessary for raw 16bit output format. 2.10 ignore error messages If errors in the bit stream are detected, the decoding process is normally halted. If the '-ign' option is specified, the decoder tries to continue with the decoding process. 2.11 accept free format bitstream If the '-ff' option is specified, a free format bitstream is accepted. 2.11 ancillary data If the bit stream contains ancillary data (user data integrated into the bit stream) the decoder can write this data into an ancillary data file. Use the switch '-a file' to specify the filename for the ancillary data. The default alignment of ancillary data is byte aligned ('-aba'). You can also use the switch '-afh' for the FhG mode. In FhG-mode, ancillary data is framed, beginning with a Sync, a length byte and has a trailing checksum. All brand names are registered trade marks of their respective owners.