|
Post by mikeukmid on Apr 9, 2009 7:14:42 GMT -5
See lbpe.wikispaces.com/WAVtoMP3 for info on conversion of wav format to mp3, utilising commandline program lame.exe and for the link for obtaining lame.exe Lame.exe can also be used with Run BASIC, executing with shell$() function. Copy lame.exe and a wave file to your RB default directory and include r$=shell$("lame.exe -b 160 filename.wav filename.mp3") in your program, where filename is of course the actual name of the wav file. Parameters '-b 160' set the bitrate to 160kB/s, for this demo. The resulting mp3 file will be saved to the same directory. All the required settings info can be found in the documentation which is included in the zip file which you can download from the link given on the lbpe page. As well as wav to mp3 conversion, lame.exe can apply filters, re-encode existing mp3 files and even decode mp3 back to wav. Switches.html found in the downloded zip file documents the available command-line switches. Mike.
|
|
|
Post by Janet on Apr 9, 2009 8:57:23 GMT -5
Mike, I've just spent the last half hour playing with your code in LB and it is amazing! (See my comments in the LB ForumJust a tidbit about LAME, it is also the encoder that the Open Source Audacity Sound Editor uses. Mike has just opened a door to yet another direction of beautiful possibilities for Run BASIC applications. I am so looking forward to experimenting with RB and Mike's code.
|
|
|
Post by mikeukmid on Apr 9, 2009 9:18:09 GMT -5
Audacity uses lame_enc.dll though, not the exe, but no doubt you already know that.
|
|
|
Post by Janet on Apr 9, 2009 12:06:45 GMT -5
Audacity uses lame_enc.dll though, not the exe, but no doubt you already know that. Yup. I should have made that more clear. Though, Audacity does require you to download the entire LAME zip with the .exe and documentation files. I had to install LAME on my computer to be able to find and use lame_enc.dll. In your example, Mike, since it's too late for me to test without uninstalling LAME, will we need to install LAME or will just having the path to lame.exe available be enough?
|
|
|
Post by davos1 on Apr 9, 2009 12:49:08 GMT -5
thanks, I downloaded also the video option recommended there, a small test worked fine to create a video file
;D
|
|
|
Post by mikeukmid on Apr 9, 2009 13:10:29 GMT -5
I had to install LAME on my computer to be able to find and use lame_enc.dll. In your example, Mike, since it's too late for me to test without uninstalling LAME, will we need to install LAME or will just having the path to lame.exe available be enough? For RB just copy lame.exe into rb's default dir together with a wav file and use the shell$() format from my original post. I find that shell$() does not work with long filepaths, particularly if spaces are involved, maybe I should try shortpath names. Incidently Audacity does not need an installer for LAME, it is sufficient to just manually select the lame_enc.dll file location on the MP3 encoding tab. Mike.
|
|
|
Post by Janet on Apr 9, 2009 14:10:34 GMT -5
Incidently Audacity does not need an installer for LAME, it is sufficient to just manually select the lame_enc.dll file location on the MP3 encoding tab. Mike. That's what I get for blindly following screen prompts! No matter, it doesn't seem to be interfering with anything, but I'll follow your rules for the other computer. Music and video... so many possibilities.
|
|