kLAME WAV to MP3 Converter


kLAME is a GUI wrapper for the LAME audio file compression utility. It was designed to allow a number of WAV files to be converted to mp3 using one or more sets of options, including LAME options; destination directory and filename tag. kLAME provides bulk conversion in one operation with the results being stored in the selected directories. Threaded operation allows the full power of latest multicore CPUs to be used for maximum speed. An example of use is to create archival compressed files, as well as lower quality compressed files for transmission or website storage. kLAME was originally developed using QT3 initially, then imported to KDevelop 3.3.1 (which includes a fork of QT3). It has now been ported to QT5. kLAME is provided under the GPL 3 licence.

The port to QT4 showed up some interesting problems.

18 March 2013: kLAME is currently outdated and needs significant bug fixing and conversion to later versions of QT. It works under Linux with QT4.8 but the Windows version is no longer usable.

3 March 2016: Updated to QT5.

Download and Installation

For Linux you will need QT5, gcc and the latest version of Lame installed. For Ubuntu install qt4-developer, qt5-qmake, g++, libmp3lame0, libmp3lame-dev. In the kLAME directory use:

$ qmake
$ make

The klame executable will be found in the klame directory.

Note: These instructions are outdated. To compile on Windows you will need to install QT5 and MinGW and set your system environment up according to the instructions provided with MinGW and QT5 open source edition. This is not straightforward so read the documentation carefully. Some additional information is provided in INSTALL-QT4 file found in the kLAME source. If you wish to use an IDE there are some notes provided here under DevC++, although its recommended to use Eclipse. You can either install the Eclipse IDE or work from the command line. Unzip one of the source packages, change to the source directory and run:

$ qmake
$ make

An earlier statically built Windows package is provided for the brave, foolhardy and lazy (those after my own heart), however it requires the MinGW runtime libraries to be installed and may not work on recent Windows distributions..

Main Window

The main window for kLAME has a table of filenames and option columns, with a row for each file and a column for each conversion option set that includes LAME options, a destination directory and a filename tag used to describe the converted files. The window provides a toolbar with a set of buttons described below. Columns are provided with checkboxes that can be used to select whether the filename will be converted according to the options set for the particular column.



  • New Project. All settings are cleared to defaults.
  • Open/Save Project. The full set of columns, options and LAME options can be saved for later restoration.
  • Open WAV Files. This dialogue allows the user to select a list of filenames and have them added to a table for later conversion. Additional selections will result in the additional files being added.
  • Remove WAV Files. This removes the currently selected row.
  • Add Columns. When pressed an additional column is added with default options.
  • Delete Column. This removes the currently selected column (or the last one if no selection is made).
  • LAME Options. When a column is added, LAME options must be set. These are able to be set for any selected column, or if no column is selected, for the last column. LAME options described separately below.
  • Convert. Begin the conversion operation. This performs all conversions requested, and informs with a message box when complete.

LAME Options

This tabbed form provides for most of the more common options to be passed to LAME.

Tab 1: General Output options.

  • Column number. This refers to the column for which options are being set. Defaults to a selected column if present, or else to the last column.
  • Output directory. Allows selection of a different output directory for each column.
  • Filename Tag. Allows for a tag to be added to the end of a filename (before the first dot) to distinguish the different conversion products.
  • Save settings. This saves a simple one-line string identical to that passed to LAME as options. These options can be used for creating new projects with standard LAME option settings.
  • Load settings. When loaded, the options string is parsed and the settings are made directly in the settings form.

Tab 2: Basic LAME Settings

The LAME settings are described on the LAME website, the MAN page for LAME and the information given by the --longhelp and --preset help options to LAME. These can change in meaning over time, so please check the website. Note that the documentation is often outdated for some options. The most accurate documentation appears to be in the --longhelp option.
  • Preference. This chooses between VBR (quality) and ABR/CBR (bitrate).
  • Relative Quality. This is a slider between 10 and 100, and provides the VBR quality setting associated with -v. The option associated with -v is determined by subtracting the slider value from 100 and dividing by 10.
  • VBR Algorithm. Chooses between --vbr-old and --vbr-new.
  • Bitrate and "use CBR". If CBR is checked, this sets --cbr and -b n. If not checked this sets --abr n. The slider provides the value of n.

Tab 3: Advanced LAME settings.

  • Mode (-m) Various mode settings (mono, stereo etc).
  • Quality (-q). Setting from a spin box 0-9 with default 5. This sets a quality factor tradeoff with bitrate that is additional to that specified for the VBR conversions.
  • High Pass Frequency (kHz).
  • High Pass Width (kHz).
  • Low Pass Frequency (kHz).
  • Low Pass Width (kHz).
  • Tonality Limit (kHz) (--cwlimit). Limit to which audible frequencies are processed.
  • Full Bandwidth (-k). No filtering applied, not even defaults. Can result in ringing.
  • Presets (--preset). These are a set of optimized default settings. It is not clear if these can be used with other specific settings.
  • Use Minimum VBR Bitrate (-b). If checked, a VBR minimum bitrate of 115kHz default is used, and minimum bitrate settings for ABR and CBR are added. LAME can experience problems if the value is too low compared to the average bitrate.
  • Use Maximum VBR Bitrate (-B). If checked, a maximum bitrate can be set on the slider. This can also cause problems with LAME if its value is too large.
  • Resample Frequency (--resample). If checked, the selected resample frequency (allowed values given in the spinbox) is used.
  • Change Quality Measure (-X). Measures 0 to 9 given in a spinbox.
  • Additional options. This allows any other options to be specified. These are parsed and invalid options are discarded if the checkbox is selected (default). Any options added that clash with those set on the form will take precedence. Any LAME option can be specified (watch that LAME does not change options over time). Options relating to stdout outputs are ignored.

Project Save file structure

This is a binary file (QT format) with an ASCII header with the program name and date, followed by:
  1. Number of columns
  2. Directory for the wav files
  3. Comment strings
  4. Filename tags
  5. Output directories
  6. LAME option strings
  7. Column Header labels

Settings

Under Linux, settings will be saved in the .config/Jiggerjuice directory in your home folder. In Windows they are in the registry HKCU/Software/Jiggerjuice.

ToDo

Plenty to do to improve kLAME but it is substantially providing the functions necessary for my work.
  1. Add some navigation buttons to Help.
  2. Add some more advanced options tabs for LAME.
  3. Allow other input formats, such as raw PCM.
  4. Do other conversions such as mp3 back to wav, etc.
  5. Handle various tag headers such as ID3.

Recent Changes (see README)

  1. Fixed a problem where columns could not be selected if no rows were visible.
  2. Added Doxygen development documentation.
  3. Fixed the same display problem in QT4.3.
  4. Fixed a display problem in QT4.2 that was not present in QT4.1.4.
  5. Some refactoring to eliminate global variables and implement signals and slots for progress dialogue.
  6. Corrected a bug that incorrectly identified the directory name when a file dialog was cancelled.
  7. Added a check and an offer to create a non-existing output directory in the options dialogue.
  8. Fixed a problem accessing an array beyond its bounds that caused a segfault.
  9. Fixed a problem where initial settings for main window size and location put it off screen under Windows.
  10. Fixed a bug where kLAME would hang waiting for non-existent threads to finish.
  11. Fixed a bug where some directory paths did not have a trailing separator under Windows.
  12. Minor change to remove 512MB limitation on wav file size.
  13. Port from QT3 to QT4.
  14. Added threading and a global progress indication.
  15. Added menus, added row deletion, changed column deletion functionality.
  16. Fixed a bug that did not synchronise sliders and spinboxes.
  17. Added a call to flush the LAME buffers at end of conversion.
  18. Added some traps in the event a file was not found during conversion.
  19. Port from QT4 to QT5.

Packages

The latest source code is kept on GitHub. The zip file can be downloaded and extracted to a suitable directory.

Windows binary (includes mingw10.dll) klame-2.0.4.exe. This has only been tested on Windows XP and is not guaranteed to work on other distributions.

References and acknowledgements:
"The LAME Project", http://lame.sourceforge.net/
"The QT Company" http://www.qt.io/
"Minimalist GNU for Windows MinGW" http://www.mingw.org/


Warning: this author uses another popular PC operating system sparingly and usually on an emergency basis, and for playing games of course. All software is developed on and for Linux, which is the only OS worth spending time and effort on, apart from the Commodore 64 that is.


Contact: My email address can be constructed from the username "ksarkies" and the ISP DNS address internode.on.net in the usual way.


First created
15 May 2006
Last Modified 3 March 2016
Ken Sarkies 2006