Sonar MP3 Encoding with LAME
If 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.
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.
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.
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 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).
74 Comments so far
Leave a reply

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?
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?
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.
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…
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.
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!
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
My guess is that you need to change the “Path” setting to the folder where you installed LAME.
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?
Sorry my mistake, I never realised you put a screenshot so I hadn’t selected the LAME format. Works perfectly, thanks a lot!
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.
Hi. I have Sonar 5 that can import mp3 files (on XP Professional) but my newer Sonar 7 (on XP Profession x64 Edition) will not import mp3 files (using the cakewalk encoder).
Will the lame encoder allow me to import mp3 files in Sonar 7 on the XP x64 computer??
Thanks
ps Sonar 7 (with cakewalk encoder) will import mp3 files om my Vista laptop
The LAME encoder just encodes on export. I haven’t found a way to import MP3 files on x64 – I have never really needed to do that, so I haven’t spent a lot of time on it.
Yeah man, works fine in 7!
Thanks a lot.
I adore Sonar 7, moved from Cubase but this ‘license’ thing is just ridiculous. Aren’t we in 21 century already???
Good luck!
Hello,
everything seems fine, your instructions are very easy, so thanks. I’m having a problem though. When I actually go to export it says: “Mix Down Aborted: Unspecified error”. Any ideas? I know there’s not much to go on. Any body else had this obscure problem?
Thanks again,
Marcus
Sorry, Marcus. I’ve never seen that. If the error is from within Sonar, you might try Cakewalk support.
worked for me on sonar 6. i’m grateful. (after being frustrated by cakewalk).
Works PERFECTLY for me using Tools/Cakewalk Encoding in Sonar 7.
I strap Waves LL-16 over my Master Channel to give me a Mastered output & now I can push that straight to mp3.
Hoorah!
does not format to mp2 for me.
just saves as a wav file
try that again
does not format as mp3 file
just as a wav file
(sheesh)(my email was wrong too)
k nvm – forgot to choose file type as Lame 192
my bad.
Now I get a “external encoder returned an error code”
any advice on this issue?
thank you SO MUCH for this tutorial. =)
I asked about the mp3 encoder in SONAR & found out that its because of a licensing agreement with the maker of the mp3 encoder. Cakewalk doesn’t make it, freunhoffer does and they require a license everytime a version is sold. Therefore they can NOT just put it into the app nor can they give it away. Most peeps that use SONAR don’t even use mp3 but some do… For these few it’s available for purchase, but is required to be that way by the maker (Fraunhoffer) and NOT Cakewalk. I’ve checked into it and found out that this is indeed true.
This screenshot tutorial worked a treat for Sonar 6 Studio. Just followed the instructions. Many thanks.
Worked great in sonar 7 – Must remember to select lame mp3 as the encoder when you choose export audio, if you have just mp3 selected you will get the cakewalk popup telling you to buy an encoder. Thanks for posting this fix by the way!!!
Works great with sonar 7 on vista…. Thank you
Okay well i think i understand the instructions but cant find the encoder configuration. I checked in tools and the directories. Is there anyway i can download the configuration tool???
Any help would be greatly appreciated.
Isai, what version of Sonar do you have?
I have sonar 3 Producer Edition.
I don’t have Sonar 3 to try it out, but everything I’ve read indicates it is in the Tools menu inside Sonar. If that doesn’t work, you might try opening your install CD in windows explorer, opening the Utilities folder, and then looking in the External Encoder Profiles folder.
ok well since this isnt my computer ill have to check that cd. Well it sounds like this might be my answer so thank-you. Ill report back if i find the answer.
im new to sonar,i was/am using fl to make beats,but i decided to get some better stuff and to bad it didn`t came with a mp3 encoder.
thanks for helping people like me out afters spending allot of money on sonar 8.why does sonar/cakewalk dont have the mp3 encoder ?
i meen fl does and u can buy the fl producer version for the half as u pay for sonar but nvm thanks to u and the free lame encoder!
peace
I upgraded to Sonar 8, and exporting mp3s seems to work fine with lame and built in encoder, but problem I’m having is that imported mp3′s keeping being imported in mono.
.Wav files are fine. Am I missing a setting somewhere? I don’t get any options after I’ve done import/audio and selected file etc – but whatever I do I keep getting a sinlgle mono file on one track – can anyone help?
Thanks.
Hi…I’m using Sonar 7, installed & configured as you stated, it encodes, but when I play the MP3 file back in Winamp, it plays really slow; like playing a cassette tape on a boom box with dying batteries. Any ideas?
I’ve not experienced that.. are you sure you set it to mix down to a 16-bit WAV file?
can someone help me! i’m using sonar 3 and i’m not finding a solution for the mp3 encoder, it is asking for a key generator!!
gabyloutfi@hotmail.com
Worked great here with SONAR 8 Studio Edition.
Thank you!
Hello
I’m using Sonar 8 on windows xp and vista on different computers
I can export mp3 files fine, but when trying to import them, the line at the bottom goes by really fast, and no file is imported…I’ve checked all settings and nothing seems to work
Any suggestions?
Thanx
Hey everyone, I’ve built the solution to the LAMEmp3 encoder problem… it’s called “Aaron’s Sonar MP3 Encoder Patch v2″ and if you Google that, you’ll find it in .torrent form, totally free.
“Problem?” you may ask. Yes! By using the external encoder config utility inside Sonar (to hook up the LAME Mp3 encoder), we are limiting ourselves to ONE bitrate option to export our MP3s in. To use another bitrate (128kbps, or 320kbps, or whatever you want to change it to) we then need to open the config tool and reset the bitrate. It’s a real pain.
The solution? use my encoder patch. You can use the 64-bit or the 32-bit version, depending on your system… and it puts options for different bitrates onto Sonar’s “Export Audio” menu! for instant exporting at the bitrates you select.
If you have any questions about how it works and what it does, or if you’d like this patch sent to you directly, please email me at blackwidowfarms@hotmail.com
…or contact me through one of my websites:
http://www.AaronBewzaMusic.com or
http://www.BlackWidowFarms.net
Thanks for your time and I’m glad I can be of assistance.
Aaron Bewza
Did I mention that I’ve built BOTH the 32-bit AND 64-bit versions of LAME into this patch? Sonar x64 users: you can verify LAME operates in true 64-bit with your task manager, watach your process list right after exporting your audio (when Lame takes over and converts to your desired bitrate).
Remember to spread the word, and feedback is ALWAYS welcome, otherwise I won’t be able to improve this patch for version 3. I wouldn’t dare charge a penny for this patch, so if you find it elsewhere and they want money for it, they are liars and not honest at all.
Aaron
Doesnt work. Same problem as many ppl here. Cant save my changes at “LAME”. Just appears
1- Put LAME into C:\LAME (last stable from http://www.free-codecs.com/Lame_Encoder_download.htm)
2- create a txt file and write this in:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CakewalkExtAudioEncoders\{495EA31D-8614-42FE-9625-F25E394ED6E7}]
“Name”=”LAME MP3 Encoder”
“Description”=”LAME MP3 Medium Quality Joint Stereo”
“Path”=”C:\\LAME”
“Extension”=”.mp3″
“CommandLine”=”lame -b 128 -m j %I %O”
“InProcess”=dword:00000000
“KeepWaveFile”=dword:00000000
3- Save the file and change extention to .reg
(if you can’t see the file extention goto (in any folder): tools->Folder Options->View
And un-check the box “Hide extention for known file types” … you can now view and change file extentions)
Now just duble-click the .reg file and add the info to regedit… Start up your sonar and just export your files
Black Angel: I tried to setup your methode..
but now when I go to Audio Export, sonar LE is shutting down and also my Cakewalk External Encoder Config isn’t working anymore.
Please help.
How to undo this installation?
Black angel: I delete the whole folder in regedit.
problem solved
WOOO!!! it Worked at first i thought this was just a scam or lost cause. but actually reading everybody elses problems contributed to the fixing of my own. AND it worked! lol and i had just purchased that unessasarly expensive Cakewalk encoder yesterday. im pretty sure you kno what im about to do now….CANCLE THAT ORDER AND GET SOME MONEY BACK! it doesnt work anyway! haha
Thanx so much
@ Jorgen: it DOES work, did you uninstall your existing LAME before trying the patch? you would be the only person so far that the Sonar patch does not work with. you know those things you are trying with these other methods? its the same thing but made super easy. Jorgen before you simply discredit the patch, ask for some help because it works like a charm. email me for version 2.1 of the patch and I can help you make sure its working. I’m at blackwidowfarms (at) hotmail.com ok talk to you later
Aaron
Seriously dude, you saved my company about $200 for all my voice talent who I got the software for. I did not find it acceptable that they were charging and was actually looking for a free mp3 encoder to use AFTER the recording, but you just eliminated an extra step.
Want a job in radio production? LOL
Thank you for sharing…its nice…and its work in Sonar 4.0.2
I did the suggestion by Blackangel…which I probably shouldn’t have. I get an error message and when I try to export. I’ve uninstalled and reinstalled and nothing!
I’m a bit scared I’ve gone and messed it up for good. So no one else do what he did please, and if you did, can you please tell me how to fix it?!
Excellent tutorial. I know of lame from linux audio work but was a bit stumped with Sonar. Thank you.
Gary
Thanks for the tutorial!
I tried to do all the above steps, but when I play back the MP3 file, it’s static! Any idea what settings I’m missing? THANKS!
Make sure you export at 16-bit!
Wow. I’m an idiot. Thanks! That cleared it up! Works great now!
I found the solution to the error message “Warning: The external encoder returned an error code. the file may not have encoded properly.”
I simply missed to make a blank space between %I and %O in the command line.
Right way:
lame -b 192 -m j %I %O
Wrong way:
lame -b 192 -m j %I%O
Thanks a lot for the trick.
Aaron Bewza October 2nd, 2009 1:17 pm
This guy’s method is freaking awesome. The other way works also, but like he says in his post it doesn’t give us the ability to use different bit rates while he does. Also if you plan on using the method described in the original posts and have not been able to have it take, make sure to run the EncoderConfig as administrator as stated by:
andy June 21st, 2008 2:00 am.
Thanks for all your assistance guys.
Just want to add my thanks. Well done. Appreciate your efforts.
I managed to solve “Warning: The external encoder returned an error code. the file may not have encoded properly” problem by NOT using the –tt and –ta (title and artist) tags.
Thanx Dave. It works like a clock in my Sonar 7. Very Good understandable instructions!
thank you so very much the snap shots made this a breeze again THNAK MAAAAAAANnnnnn…..
Hey,
I use Sonar LE and IT WORKED. While exporting, Sonar automatically puts an extension *.mp3 in the place where you type in file name. Just delete the *.mp3 while exporting.
For those who are getting the error message,
“Warning: The external encoder returned an error code. the file may not have encoded properly”
One of the reason could be %I and %O typed in small letters. The command line switches %I and %O should be in CAPITAL LETTERS.
lame -b 192 -m j %I %O
(lame -b 192 -m j %i %o will give the above warning and does not produce Mp3 file)
Hope this helps to someone.
Thank You! Works great. I actually paid for the other one and then lost it when I reloaded Sonar 6.
Contrary to what Aaron says above, you can give yourself multiple easily selectable bitrate options by clicking the ‘new’ button (shown in the screenshot right at the top) and creating a new friendly name and matching set of lame command line switches for each option you need.
Each time you hit ‘new’, a new registry key matching the format shown by Blackangel above is created. This is how both the setup utility and Sonar ‘remember’ the settings.
Given the existence of the encoder setup utility and that messing with the registry isnt generally recommended, you shouldnt need to use .reg files unless you want to quickly transfer settings to a new machine.
If you must (!!) click start=>run=> and type regedit. Browse to and select [HKEY_CLASSES_ROOT]\CakewalkExtAudioEncoders\ then click file=>export. This creates a .reg file which is actually just text. *.reg files are blocked by security programs, so they are best communicated as text (rename to *.txt). Renaming the file back to *.reg and double-clicking it on a target machine will add matching data to its registry and hence all your MP3 export options to Sonar.
hi i am using sonar 7 home edition and i cant find the shared utilites or external encoder anywhere
Thank you all for the information on getting this up and running, It is information like this that inspires us all. Im using Vista 32/Sonar 7, and like others had a few problems getting this to work, but I did. Here’s my insight (from my install):
1) Do not copy and paste the information from the tutorial , type it into EncoderConfig.exe manually. This is because of unicode characters in the web page. Windows hates unicode . This was my first issue, and I solved it by typing the info in.
2)Make sure that the audio that you are exporting is set to 16 bit depth. 24, 32, and 64 bit depth do not export on my setup but 16 bit exports in all of the settings. I suspect that this is a limitation of mp3 itself as other exporter/convertors want 16 bit as well.
Hope this info helps any who are still stuck.
Run the encoder config as administrator if you are in Windows 7, otherwise it will not save the lame setup.
Aaron’s Sonar Patch v5.2
It’s got a cool easy-to-use interface and it works perfectly with Sonar X1 and all previous versions of Sonar. It adds ALL available mp3 options (44 separate options) directly into Sonar’s “Export Audio” menu, and uses Lame v3.98.4 as the encoder engines. Both 32 and 64-bit encoders are included, the correct one is automatically used.
It is 100% free, no strings ever. I could not afford my website this year, but you can email me for a copy:
blackwidowfarms (at) hotmail.com
I’m glad to be able to provide this patch for the audio community… cheers!
Aaron Bewza
….or look me up on the Cakewalk Forums, look for more information about the patch in the developer’s section.
This tutorial was impossibly helpful. Thank you very much. This will save everyone 20 dollars that they don’t need to spend.
*NOTE* FOR VISTA AND WINDOWS 7 USERS YOU MUST RUN THE ENCODER CONFIG AS ADMINISTRATOR FOR THE CHANGES TO TAKE EFFECT!
Worked for me, instructions were very straight forward, thanks.
Just installed as per instructions with Sonar 8. Works seamlessly. Cheers.
Thanks a heap – worked straight up in Sonar X1. Have your next beer on me! Cheers!