ACMENC

download

Download: acmenc-0.6.zip
Version: 0.6
Updated: 2008/2/17 Sunday
Size: 382.27 KB

Powered by Drain Hole

Introduction

ACMENC is an audio encoding tool for ACM (ACM Audio Compression Manager) codecs with command-line interface. It enables us to convert audio source (e.g., WAV/AIFF/AU) into compressed audio (currently MP3). Although a number of GUI-based applications that use ACM codecs exists, this program features:

  • Command-line interface
  • MP3 Info (formally called as LAME Tag) tagging for gapless playback
  • Built-in ID3v1/ID3v2 tagging by using id3lib.dll
  • Support of multiple source formats by using libsndfile.dll
  • Support of Monkey’s Audio source by using MACDll.dll
  • Partial encoding mode that may be useful for cuesheet encoding
  • Preset or alias support to specify codec name and other parameters by one word

Installation

Place all binaries (acmenc.exe and DLLs) and configuration file (acmenc.cfg) in the same directory. That’s all for installation of this program, but make sure that you have ACM codecs installed properly in your computer.

Usage Guide

Fundamentals

After finishing installation, enter the following line to inquire names of installed ACM codecs:

C:\>acmenc -ld
ACMENC version 0.6  Copyright (c) 2004 by Nyaochi  (Thu, 16 Sep 2004)
[00145688] Microsoft IMA ADPCM Version 4.0.0
Microsoft IMA ADPCM CODEC
Copyright (C) 1992-1996 Microsoft Corporation

[00145848] MS-ADPCM Version 4.0.0
Microsoft ADPCM CODEC
Copyright (C) 1992-1996 Microsoft Corporation

[00145A20] Microsoft CCITT G.711 Version 4.0.0
Microsoft CCITT G.711 A-Law and u-Law CODEC
Copyright (c) 1993-1996 Microsoft Corporation

[00145C00] Microsoft GSM 6.10 Version 4.0.0
Microsoft GSM 6.10 Audio CODEC
Copyright (C) 1993-1996 Microsoft Corporation

[00145DD8] TrueSpeech(TM) Version 1.0.0
DSP Group TrueSpeech(TM) Software CODEC
Copyright (C) 1993-1996 DSP Group, Inc.

[00145FB0] Microsoft G.723.1 Version 1.2.1
Microsoft G.723.1 CODEC
Copyright c 1996 Intel Corporation and Microsoft Corporation

[00146188] WM-AUDIO Version 4.2.0
Windows Media Audio
Copyright (C) Microsoft Corporation, 1999 - 2001

[00146368] ACELP.net Version 3.2.0
Sipro Lab Telecom ACELP.net audio codec
Copyright c 1995-99 Sipro Lab Telecom Inc., Montreal

[001468A8] IndeoR audio software Version 2.5.53
IndeoR audio software
Copyright c 1997 Intel Corporation

[00146A80] MPEG Layer-3 Codec  Version 1.9.305
Fraunhofer IIS MPEG Layer-3 Codec (advanced)
Copyright c 1996-1999 Fraunhofer Institut Integrierte Schaltungen IIS

[00146C58] MPEG Layer-3 Codec Version 3.3.44
Fraunhofer IIS MPEG Layer-3 Codec (professional)
Copyright (C) 1996-2004 Fraunhofer IIS

[00146E30] MS-PCM Version 5.0.0
Microsoft PCM Converter
Copyright (C) 1992-1996 Microsoft Corporation

Each item shows detailed information about the ACM codec:

  • ID (e.g., 00146C58)
  • Short name (e.g., MPEG Layer-3 Codec)
  • Version number (e.g., 3.3.44)
  • Long name (e.g., Fraunhofer IIS MPEG Layer-3 Codec (professional)
  • Copyright information (e.g., Copyright (C) 1996-2004 Fraunhofer IIS)

ACMENC uses the long name for identification string. You must specify an exact long name for manupulating the codec or use presets.

To inquire convertible formats from a source audio, enter the following command:

C:\>acmenc [-c <codec-name>] -lf <input>

This opens the audio file to retrieve the format information and inquire possible formats to which ACM codec can make a convertion from the source. The following example is to inquire "Fraunhofer IIS MPEG Layer-3 Codec (professional)" the convertible formats from a 44.1kHz/16bit/2ch audio:

C:\>acmenc -c "Fraunhofer IIS MPEG Layer-3 Codec (professional)" -lf input.wav
ACMENC version 0.6  Copyright (c) 2004 by Nyaochi  (Thu, 16 Sep 2004)
[1] Fraunhofer IIS MPEG Layer-3 Codec (professional)
  44.100 kHz, 8 Bit, Stereo
  PCM (WAVE) 44kHz 8bit 705Kbit/s 2ch

[2] Fraunhofer IIS MPEG Layer-3 Codec (professional)
  44.100 kHz, 16 Bit, Stereo
  PCM (WAVE) 44kHz 16bit 1411Kbit/s 2ch

[3] Fraunhofer IIS MPEG Layer-3 Codec (professional)
  320 kBit/s, 44.100 Hz, Stereo
  MPEG1 Layer-III 44kHz 320Kbit/s 2ch

[4] Fraunhofer IIS MPEG Layer-3 Codec (professional)
  256 kBit/s, 44.100 Hz, Stereo
  MPEG1 Layer-III 44kHz 256Kbit/s 2ch

[5] Fraunhofer IIS MPEG Layer-3 Codec (professional)
  224 kBit/s, 44.100 Hz, Stereo
  MPEG1 Layer-III 44kHz 224Kbit/s 2ch

[6] Fraunhofer IIS MPEG Layer-3 Codec (professional)
  192 kBit/s, 44.100 Hz, Stereo
  MPEG1 Layer-III 44kHz 192Kbit/s 2ch

[7] Fraunhofer IIS MPEG Layer-3 Codec (professional)
  160 kBit/s, 44.100 Hz, Stereo
  MPEG1 Layer-III 44kHz 160Kbit/s 2ch

[8] Fraunhofer IIS MPEG Layer-3 Codec (professional)
  128 kBit/s, 44.100 Hz, Stereo
  MPEG1 Layer-III 44kHz 128Kbit/s 2ch

[9] Fraunhofer IIS MPEG Layer-3 Codec (professional)
  112 kBit/s, 44.100 Hz, Stereo
  MPEG1 Layer-III 44kHz 112Kbit/s 2ch

[10] Fraunhofer IIS MPEG Layer-3 Codec (professional)
  96 kBit/s, 44.100 Hz, Stereo
  MPEG1 Layer-III 44kHz 96Kbit/s 2ch

This process is omissible if you have already known possible output formats for the ACM codec.

To encode a source audio, use the following command-line:

C:\>acmenc -c <codec-name> -b <bitrate> <input> [output]

The following is an example to encode a source audio (01_unwritten.wav) with "Fraunhofer IIS MPEG Layer-3 Codec (professional)":

C:\>acmenc -c "Fraunhofer IIS MPEG Layer-3 Codec (professional)" -b128 01_unwritten.wav
ACMENC version 0.6  Copyright (c) 2004 by Nyaochi  (Thu, 16 Sep 2004)
Input: 01_unwritten.wav (Microsoft WAV 44.1kHz 16bit 2ch)
Output: 01_unwritten.wav.mp3 (MPEG1 Layer-III 44kHz 128Kbit/s 2ch)
Fraunhofer IIS MPEG Layer-3 Codec (professional) Version 3.3.44
Copyright (C) 1996-2004 Fraunhofer IIS
|%%%%%%%%%%%%%%%%%%%%%%%%%| 100% 3.89sec at 55.6x
Writing MP3 Info frame.

More easier way to encode a source audio is to use presets. The ACMENC distribution contains three presets (fiis-adv, fiis-pro, and lame). You can use these presets for encoding as follows:

C:\>acmenc -p fiis-adv -b <bitrate> <input> [output]
C:\>acmenc -p fiis-pro -b <bitrate> <input> [output]
C:\>acmenc -p lame -b <bitrate> <input> [output]

This example again converts a source audio with "Fraunhofer IIS MPEG Layer-3 Codec (professional)" but uses a preset for the codec:

C:\>acmenc -p fiis-pro -b128 04_unwritten.wav
ACMENC version 0.6  Copyright (c) 2004 by Nyaochi  (Thu, 16 Sep 2004)
Input: 04_unwritten.wav (Microsoft WAV 44.1kHz 16bit 2ch)
Output: 04_unwritten.wav.mp3 (MPEG1 Layer-III 44kHz 128Kbit/s 2ch)
Fraunhofer IIS MPEG Layer-3 Codec (professional) Version 3.3.44
Copyright (C) 1996-2004 Fraunhofer IIS
|%%%%%%%%%%%%%%%%%%%%%%%%%| 100% 5.13sec at 50.6x
Writing MP3 Info frame.

MP3 Info

If you know the exact encoder delay of an MP3 ACM codec, you can specify it by –enc-delay option to store this value in MP3 Info frame. Then ACMENC automatically calculates how many samples the encoder padded at the end of the track and store the padding value in MP3 Info frame. These fields in MP3 Info frame help a decoder calculate accurate length of the track and consequently achieves gapless playback.

For example, to make MP3 files that contain information of accurate length with ACM codec "LAME MP3 Codec v0.9.0 - 3.96 (stable)", which has encoder delay of 576 samples, use the following line:

acmenc -c "LAME MP3 Codec v0.9.0 - 3.96 (stable)" --enc-delay 576

Some ACM encoders such as "Fraunhofer IIS MPEG Layer-3 Codec (advanced)" lose several frames at the end of tracks because of their poor consideration or implementation. With the aim of compensating this bad ’specification’ of these ACM codecs, ACMENC has a feature (–pad-silence option) to pad silent samples manually at the end of tracks. See "Codec Guide" in this document for more discussion.

Another thing ACMENC do for MP3 Info frame is setting a vender string. Some audio players such as "Sound Player Lilith" read this field to show codec information. ACMENC does not set a proper vender string automatically because it is not designed for one codec but for all codecs and does not know the appropriate value. In addition to that, I don’t want to see chaotic situation in which uses set vender strings in their own manners. Therefore, I provide you with the best solution of this problem in the form of preset (or alias). Use presets for at least FIIS/LAME encoders instead of specifying these parameters (including codec name and encoder delay) arbitrarily. See "Presets" in this document to make all of us happy.

Partial encoding mode

ACMENC takes –begin and –end options to limit time range of a source audio to be passed to an ACM encoder. If you specify the beginning position of a track in a CD image and the ending position of the track, you will receive a MP3 file of very the track. ACMENC employs "mm:ss:ff" format for specifying time position (ff is frame number: 1 [frame] = 1/75 [sec]).

To encode "CDImage.wav" from 03:32:18 to 07:45:02 to "02.mp3" with LAME ACM codec, use the following line:

C:\>acmenc -p lame --begin 03:32:18 --end 07:45:02 CDImage.wav 02.mp3

If you would like to encode an audio CD image with ACMENC, consider using Audio CD Image Reader (ACDIR).

MP3 tagging

ACMENC uses id3lib.dll to tag ID3v1/ID3v2. You can use LAME-like options (e.g., –tt, –ta, –tl, etc.) to add tag information to output files. For example,

C:\>acmenc -p fiis-pro -b 128 --tt "Unwritten" --ta "Natasha Bedingfield"
--tl "Unwritten" 04_unwritten.wav
ACMENC version 0.6  Copyright (c) 2004 by Nyaochi  (Thu, 16 Sep 2004)
Input: 04_unwritten.wav (Microsoft WAV 44.1kHz 16bit 2ch)
Output: 04_unwritten.wav.mp3 (MPEG1 Layer-III 44kHz 128Kbit/s 2ch)
Fraunhofer IIS MPEG Layer-3 Codec (professional) Version 3.3.44
Copyright (C) 1996-2004 Fraunhofer IIS
|%%%%%%%%%%%%%%%%%%%%%%%%%| 100% 5.14sec at 50.5x
Writing MP3 Info frame.

Reference

C:\>acmenc --help
ACMENC version 0.6  Copyright (c) 2004 by Nyaochi  (Thu, 16 Sep 2004)

ACMENC is a tool for converting audio data using ACM codecs

USAGE: acmenc [options] [input] [output]
  [input]               input filename or '-' (STDIN input)
  [output]              output filename (STDOUT is not supported)

Encoding options:
  -c, --codec           ACM codec name for encoding (must be a long name)
  -b, --bitrate         bitrate for encode
  -F, --dest <format>   string representation of destination format for encode
  -h, --hq              high quality or non-realtime encoding
  -p, --preset <name>   apply preset described in acmenc.cfg
      --begin <time>    begin position of encoding (for cuesheet use)
      --end <time>      end position of encoding (for cuesheet use)
      --pad-silence <n> pad n samples of silence at the end
Encoding options only for MP3:
      --tt <title>      audio/song title
      --ta <artist>     audio/song artist
      --tl <album>      audio/song album
      --ty <year>       audio/song year of issue (1 to 9999)
      --tc <comment>    user-defined text
      --tn <track>      audio/song track number
      --tg <genre>      audio/song genre name
      --add-id3v2       force addition of ID3v2 tag
      --id3v1-only      add only ID3v1 tag
      --id3v2-only      add only ID3v2 tag
      --tv <vener>      encoder vender string to be stored in MP3 Info tag
      --enc-delay <val> encoder delay in samples to be stored in MP3 Info tag
Information options:
  -ld,--list-drivers    show ACM drivers installed in this computer
  -lf,--list-formats    show possible output formats for the input
      --help            show this usage

Presets

Configuration file (acmenc.cfg) defines presets that are activated by -p option. Describing the following line in acmenc.cfg:

fiis-pro: -c "Fraunhofer IIS MPEG Layer-3 Codec (professional)" -b128 --enc-delay 672
--tv "FIIS3.2"

you can use "-p fiis-pro" instead of the long command-line above.

Format of the configuration file is:

<preset-name>: <command-line-to-be-expanded>

The default acmenc.cfg contains three presets:

fiis-adv
"Fraunhofer IIS MPEG Layer-3 Codec (advanced)"
fiis-pro
"Fraunhofer IIS MPEG Layer-3 Codec (professional)"
lame
"LAME MP3 Codec v0.9.0 - 3.96 (stable)"

These presets also set MP3 Info parameters and therefore may be extremely convenient.

Codec Guide

"Fraunhofer IIS MPEG Layer-3 Codec (advanced)" (l3codeca.acm)

This codec should be installed in most computers. Available bitrate is limited up to 56Kbps (consequently only for MPEG2). I don’t use this codec for daily music listening. But it may be useful for converting 22.05/16kHz audio source. This encoder has delay of 864 sample, which is same as l3enc and MP3 Production Pro. This encoder loses several frames at the end of tracks. For this reason, "fiis-adv" preset inserts 3456 (576*6) samples at the end of tracks.

"Fraunhofer IIS MPEG Layer-3 Codec (professional)" (l3codecp.acm)

New version of this codec will be copied (not installed) to your computer during WMP10 installation. Although we can convert CD to MP3 only by using WMP10, we cannot use this ACM codec from other applications by default.

To activate it, you must make a registory hack or rename the file name. I don’t use this codec for high quality encoding or archiving. But this codec may be a good encoding solution because it is very fast and its quality is quite acceptable. You may be satisfied with this codec if you are looking for a good encoder for low/mid bitrate range. As far as I use this codec, I recommend you not to use -h option (high quality or non-realtime encoding) with this codec because it seems that high quality mode sometimes produces annoying artifacts. Encoder delay is 672 sample, similarly to FastEnc.

"LAME MP3 Codec v0.9.0 - 3.96 (stable)" (lame.acm)

An ACM codec version of the king of open-source (not) MP3 encoder, LAME. A number of uses prefer LAME to F-IIS encoders this time around. The quality of 128Kbps is also far from transparent for me. But quality of high bitrate range is quite good. I think one weak point of this codec is encoding speed. LAME 3.xx CBR (ca. 9x in my computer) is 4-5x slower than F-IIS professional codec (ca. 40x). I don’t think it’s a wise chice to use ACMENC because LAME has a good command-line interface. Encoder delay is 576 sample.

Download

License

ACMENC uses libsndfile and id3lib licensed under GNU Library General Public License (LGPL). Follow the LGPL license when distributing these libraries.

ACMENC itself is provided ‘as-is’, without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions (known as zlib license):

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

Acknowledgement

I would like to thank Erik de Castro Lopo (libsndfile developper) and id3lib project. I also wish to thank t2t2 for pointing me a bug and Nothern Verse (the author of Sound Player Lilith) for showing me a number of useful information concerning ACMENC bugs.