Sonar MP3 Encoding with LAME

LAMEIf you want to export MP3s with Sonar, and don’t want to pay $19 for the Cakewalk encoder (or it doesn’t work on your system), there is a free encoder called LAME that can be integrated into Sonar. This tutorial will show you how to configure Sonar to encode MP3s with LAME.

First you need to Download LAME. I chose the latest stable version. I would not recommend using an alpha or beta version, since they may not be as stable.

Open the ZIP file and copy lame_enc.dll and lame.exe into a folder on your hard drive. It can be anywhere. I chose C:\Program Files (x86)\LAME - if you’re not running a 64-bit version of Windows, you might choose C:\Program Files\LAME.

Next you have to configure Sonar to use LAME. For Sonar versions 3 through 5, look in the Tools > Cakewalk Ext. Encoder Config menu. For Sonar 6 (and probably 7), you’ll have to find the program on your hard drive. Mine was in C:\Program Files\Cakewalk\Shared Utilities.

Encoder Config

Run this program and fill out the screen to configure the LAME encoder. For Friendly Name you can choose anything you want. I chose to call mine “LAME 192 Kbps.” In Description I wrote “LAME MP3 Encoder 192 Kbps.” Change Extension to “.mp3″ and uncheck the Keep Wave File option.

In the Path field, find or type in the name of the folder where you installed LAME.

In the Command Line field, you need to put the LAME options. To make a 192 Kbps Joint Stereo MP3, I used the following options. (There’s more about options at the bottom of this article).

lame -b 192 -m j %I %O

Choose Save and then Close.

LAME Configuration

Now Sonar should be ready to encode MP3s with LAME. To test it out, open Sonar and find a project. Go to the File > Export > Audio menu like you would for an ordinary mixdown. Make sure you mix down to a 16 bit file - this is very important, since LAME can only handle 16-bit WAV files.

In the Files of Type selection, choose the Friendly Name that you made above. Now you can click Export and Sonar will first mix down your project, and then send it to LAME for encoding. You’ll see a little window pop up where you can watch LAME’s progress.

LAME Export
Click to enlarge

LAME Options

By changing the Command Line field in the External Encoder Configuration, you can change the type of file that LAME produces. The “%I %O” options set up the input and output files so LAME can work with Sonar. You should leave these alone, and make sure they’re always at the end of the command line.

You can read more about the options here. If you just want some useful settings, try these:

lame -b 128 -m j %I %O - Produces a 128 Kbps joint-stereo MP3. (Change the 128 to whatever bitrate you want).

lame --preset 200 %I %O - Produces an MP3 with an average bitrate of around 200 Kbps.

lame -V2 %I %O - Produces a variable bitrate (VBR) MP3 with a “quality” of 2. Quality can be between 0 (highest) and 9 (lowest).

11 Comments so far

  1. Witch Wyzwurd November 26th, 2007 1:12 pm

    I am using Sonar 6. I was upset when discovering that I spent a few hundred dollars, but had to pay extra for a simple mp3 encoder. So I am glad I found your lesson and suggestion about LAME. I downloaded the .exe and .dll files for “LAME 7 final” from the site connected to the link you provided… thanks. I filled out the Sonar box exactly as you described, but when I click the “Save” button, all that happens is my “friendly name” erases. If I click close and check the export menu in Sonar under the types menu, my name doesn’t appear (probably because it erases everytime). I even went as far as to check if the “Delete” and “Save” buttons were tangled up somehow, but that’s not it either. Is this some trick that Sonar uses to make a user buy their encoder? Why is this happening?

  2. Dave December 12th, 2007 12:50 am

    I don’t know what is happening on your system. I do know that it works on mine, so I don’t think it’s an evil Cakewalk conspiracy. Have you tried clicking the “New” button and starting over?

  3. Todd February 26th, 2008 5:29 pm

    Yeah I am having the same problem. I input all of the info, but get nothing when I try to pull it up in Sonar6. :(

  4. Raymund March 23rd, 2008 2:18 pm

    I tried this and I everything went well. I’ve been trying to find a way to encode directly to mp3 as I find it unreasonable to charge the customers who pay hundreds for the app an extra $20.00 for a small utility. Thank you so much for this tutorial…

  5. Smiler April 21st, 2008 12:53 pm

    Thanks for this - i have been looking for an mp3 decoder for Sonar for a while. I know have reasonably sized files to stick on the internet.

  6. Jeroni June 4th, 2008 8:01 am

    Thanks for this encoder. I’m using Sonar 4, and found your solution just when I was quite near buying the cakewalk encoder…
    I installed it following your instructions and it worked!!!!
    Thanks again!

  7. jack c. June 7th, 2008 1:37 pm

    hey mate:i’m using sonar 6 and want to export using lame mp3.did the following:
    1. In Sonar, choose Tools -> Cakewalk Ext. Encoder Config.
    2. In the Friendly Name Field type Lame MP3 Encoder.
    3. In the Extension field type .mp3
    4. You can put whatever you want in the Description field to comment on this configuration of Lame.
    5. Leave the Path field set to C:\Program Files\Cakewalk\Shared Utilities
    6. In the Command Line field type lame -b 192 -m j %I %O
    7. Press the Save button at the top of the box.
    8. Click Close.

    When exporting, choose Lame MP3 Encoder.

    now the following comes up
    unable to launch lamp mp3 encoder “Warning: The external encoder returned an error code. the file may not have encoded properly
    how to fix this?
    thanks,
    jack

  8. Dave June 10th, 2008 9:34 am

    My guess is that you need to change the “Path” setting to the folder where you installed LAME.

  9. Keith June 20th, 2008 6:52 am

    Hi I’m using Sonar 7, went through everything like you said but it still says I need to download the mp3 encoder from Cakewalk?

  10. Keith June 20th, 2008 6:55 am

    Sorry my mistake, I never realised you put a screenshot so I hadn’t selected the LAME format. Works perfectly, thanks a lot!

  11. andy June 21st, 2008 2:00 am

    For those of you having problems with the name disappearing after clicking “Save”, if you’re using Windows Vista, make sure that you run EncoderConfig as administrator. You can do this by right-clicking on encoderconfig.exe, then select Run as administrator.

Leave a reply