Recent

Author Topic: LAME MP3 encoder  (Read 704 times)

Tomxe

  • Full Member
  • ***
  • Posts: 109
LAME MP3 encoder
« on: May 14, 2026, 09:48:37 pm »
Pure Pascal LAME MP3 encoder, just CBR:
https://github.com/Xelitan/Free-Pascal-port-of-Lame-MP3-encoder/

License: GNU LPGL (like original LAME)

« Last Edit: May 15, 2026, 11:38:10 am by Tomxe »

Thaddy

  • Hero Member
  • *****
  • Posts: 19278
  • Glad to be alive.
Re: LAME MP3 encoder
« Reply #1 on: May 15, 2026, 04:59:00 pm »
The fixed rate (128) in the converter is way too low and has inferior audio quality compared to the default mp3 converter in Windows11 from Fraunhofer, the PCM driver. The code supports up to 320, so make it higher, like 256. As it is it is only usable for game audio.
« Last Edit: May 15, 2026, 05:19:45 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

cdbc

  • Hero Member
  • *****
  • Posts: 2818
    • http://www.cdbc.dk
Re: LAME MP3 encoder
« Reply #2 on: May 15, 2026, 06:35:30 pm »
Hi
With today's hardware, set fixed bitrate @ 320 kbps, why bother with less  %)
I was under the impression that the port is a _full_ port of 'lame', is it not?
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Tomxe

  • Full Member
  • ***
  • Posts: 109
Re: LAME MP3 encoder
« Reply #3 on: May 16, 2026, 07:07:40 am »
LAME can do both CBR (constant bitrate) and VBR (variable bitrate). This port can only do CBR. This port comes with a command-line tool to compress WAV to MP3 and this tool has hardcoded bitrate. Soon I will provide some functions to compress WAV to MP3 where bitrate can be set.

Tomxe

  • Full Member
  • ***
  • Posts: 109
Re: LAME MP3 encoder
« Reply #4 on: May 16, 2026, 07:52:02 am »
Now the program accepts bitrate:

wav2mp3 input.wav output.mp3 320

but there is also LameSimple.pas with these 2 functions for easy usage in code:


Code: Pascal  [Select][+][-]
  1. function WAVToPCM(const WavBytes: TBytes; out Info: TPCMInfo): TPCMSamples;
  2.  
  3. function PCMToMP3(const Samples: TPCMSamples; const Info: TPCMInfo; BitrateKbps: Integer): TBytes;

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1285
Re: LAME MP3 encoder
« Reply #5 on: May 16, 2026, 07:54:46 am »
Now the program accepts bitrate:

wav2mp3 input.wav output.mp3 320

but there is also LameSimple.pas with these 2 functions for easy usage in code:


Code: Pascal  [Select][+][-]
  1. function WAVToPCM(const WavBytes: TBytes; out Info: TPCMInfo): TPCMSamples;
  2.  
  3. function PCMToMP3(const Samples: TPCMSamples; const Info: TPCMInfo; BitrateKbps: Integer): TBytes;

Thanks.

 

TinyPortal © 2005-2018