computing - www.mjo.co.uk

Programming Projects

MP3 Compressor [2 Versions]

Introduction/Preamble

The purpose behind constructing the Audio MP3 Compressors, was in fact to introduce myself to Audio Compression in general, and also to investigate Lame - generally accepted as a very successful MP3 Compressor[1] - and also in order that I could hopefully add audio compression to my already existing CD Player-Converter - which, if you are interested can be read about Here which already had the facility to Load and Read an Audio CD, Calculate the CD Fingerprint and ID, Load the Track Data and/or access the CD Database to download the CD Track Listing and detail if necessary, and can also be used record the Raw CDA to a Wave file, but, had no facility whatsoever to provide any form of Audio Compression. The reason I ended up with 2 Versions, was the fact that I initially tried, and used, the Full Lame Executable, which allows for a very simple interfacing requirement - which is not readily apparent!- needing only a few lines of code in order to provide and secure a successful MP3 Compression.

Version 2 came about by wondering whether of not there would be any benefit to be derived from using the Lame DLL approach as an alternative to using the executable.

MP3 Compressor Version 1

I feel that the above preamble covers most of what the project was all about, and will just add a few notes here to cover, which after all, is a very simple, straightforward and pretty well self explanatory useage GUI ...

•   I personally found difficulty in establishing certain requirements of the set-up arrangements, and given how simple it is to set up - when you know how! - I was very surprised that this is not covered - effectively - in the Site Documentation - certainly not from what I was able to find anyway!
 
•   Notwithstanding the above comments, the Bit and Sampling Rate are also easily set through the Process Arguments.
 
•   The Audio TextBoxes do in fact only contain the Actual Filenemes - to avoid clutter! - although the IN and OUT variables do contain the full and complete Path/File details required for the Process Arguments.
 
•   Whilst I have not looked at the Source as yet, it would appear that the Compression process takes place in a Thread, but could not find any way - certainly none that I could see - of getting any progress feedback, and simply ended up here using the busy cursor.
 
•   Again I could not find any separated argument detail when using the Lame Executable and just used the Version argument, read via standardout and used a simple Sub/Split function to provide the Lame details, and also included a button to provide the full Lame header detail. I elected to use the 2012 Version of Lame as the header from the earlier versions can be quite lengthy, and in cases such as these, I always try to elect detail which tries to keep information images as small as possible!

ScreenShots of the MP3 Compressor - Version 1

Main Dialog    About Dialog
Fig.1 - Main Dialog    Fig.2 - About Dialog
 
Lame Header
Fig.3 - Lame Header Dialog

MP3 Compressor Version 2

Again, the above preamble covers most of what the projects were all about, and again the GUI useage is self explanatory and needs little explanation.

•   Unlike using the Lame executable directly as outlined in the above application, using the Lame DLL is a whole different scenario, needing a much more elaborate coding requirement
 
•   Compression progress is available and is used in this version, and is included both as a percentage completed notification in the status bar, and also as a standard TrackBar Indication
 
•   Like the above, the Audio TextBoxes contain only the Actual Filenames, using a separate variable for the complete path and filename details
 
•   Putting together an Application using the DLL, is not I would say, a project to be undertaken by the faint hearted - and will leave it at that! ...

ScreenShots of the MP3 Compressor - Version 2

Main Dialog    About Dialog
Fig.1 - Main Dialog    Fig.2 - About Dialog
 
Operational
Fig.3 - In Operation

Epilogue/Conclusions

I think the conclusions that can be drawn are pretty well self evident from reading the above coverage, and see little point in treading the same ground again!

The MP3 Compressor Utilities/Application Software

As previously stated, these applications were not developed as Stand-Alone Applications and were only designed as a self introduction the the subject, but will release them in the hope that they may aid any interested party in the subject. The Download Archives include this Document, but 'DO NOT' include the Lame Executable or DLL Files, and it is left up to the individual user to visit the Lame Site, and download the relevant files. Also, there are many other Sites that do in fact have earlier versions, if required. The Applications have been tested with all Lame Versions back to 2008, the User simply having to include the relevant file[s] in the project application path. A notification and 'WARNING' Dialog is shown if the user tries to run the application without the necessary file[s] being present ... Then - Just Simply Run it! ... Use it! ... Remove it, as required!

Reference

[1] Although the Software performed quite well in respect of its functionality - when I did in fact get it operational! - I certainly felt that both the Lame Site, and its content lack in many respects, particularly regarding explanations of interaction/useage, or any straightforward examples of utilisation, and the only document I found to be of any value, was the useage file, which certainly would not be of any great help to a newcomer! and given that - as stated above - that only a few lines of code are needed along with a Process Start to perform adequate MP3 Compression, I certainly felt that given the time and effort that must have gone into producing the Software, I felt a little more thought, time and effort could have been directed to its Operational Use! certainly in regard to the provision of a few basic examples! Back