Kompilera Lame

Detta exempel är för Mac OS X Snow Leopard (Kräver XCode som kan laddas hem gratis från www.apple.com). Proceduren är likvärdig för Linux. För Windows datorer rekommenderar jag att hämta färdigkompilerade program.

Steg 1)

Tidigare har jag upptäckt att det blir glitchar i mp3 filer, speciellt när man konverterar AIF filer. Libsndfile gör att  filerna läses på ett korrekt sätt.

Hämta först hem libsndfile

www.mega-nerd.com/libsndfile/

eller från kommandoraden

curl -O 'http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.25.tar.gz'

Senaste versionen när jag skrev detta var libsndfile-1.0.25.tar.gz

Packa upp

tar xzvf libsndfile-1.0.25.tar.gz
cd libsndfile-1.0.25

Kompilera

./configure
make
make check
sudo make install

sndfile ger några roliga extra program, testa:

sndfile-convert --help     

Usage : sndfile-convert [options] [encoding] <input file> <output file>

where [option] may be:

-override-sample-rate=X : force sample rate of input to X

where [encoding] may be one of the following:

-pcms8 : force the output to signed 8 bit pcm
-pcmu8 : force the output to unsigned 8 bit pcm
-pcm16 : force the output to 16 bit pcm
-pcm24 : force the output to 24 bit pcm
-pcm32 : force the output to 32 bit pcm
-float32 : force the output to 32 bit floating point
-ulaw : force the output ULAW
-alaw : force the output ALAW
-ima-adpcm : force the output to IMA ADPCM (WAV only)
-ms-adpcm : force the output to MS ADPCM (WAV only)
-gsm610 : force the GSM6.10 (WAV only)
-dwvw12 : force the output to 12 bit DWVW (AIFF only)
-dwvw16 : force the output to 16 bit DWVW (AIFF only)
-dwvw24 : force the output to 24 bit DWVW (AIFF only)
-vorbis : force the output to Vorbis (OGG only)

The format of the output file is determined by the file extension of the
output file name. The following extensions are currently understood:

aif : AIFF (Apple/SGI)
wav : WAV (Microsoft)
au : AU (Sun/NeXT)
caf : CAF (Apple Core Audio File)
flac : ????
snd : AU (Sun/NeXT)
svx : IFF (Amiga IFF/SVX8/SV16)
paf : PAF (Ensoniq PARIS)
fap : PAF (Ensoniq PARIS)
gsm : RAW (header-less)
nist : WAV (NIST Sphere)
htk : HTK (HMM Tool Kit)
ircam : SF (Berkeley/IRCAM/CARL)
sf : SF (Berkeley/IRCAM/CARL)
voc : VOC (Creative Labs)
w64 : W64 (SoundFoundry WAVE 64)
raw : RAW (header-less)
mat4 : MAT4 (GNU Octave 2.0 / Matlab 4.2)
mat5 : MAT5 (GNU Octave 2.1 / Matlab 5.0)
mat : MAT4 (GNU Octave 2.0 / Matlab 4.2)
pvf : PVF (Portable Voice Format)
sds : SDS (Midi Sample Dump Standard)
sd2 : SD2 (Sound Designer II)
vox : RAW (header-less)
xi : XI (FastTracker 2)
wve : WVE (Psion Series 3)
oga : ????
mpc : MPC (Akai MPC 2k)
rf64 : RF64 (RIFF 64)

Steg 2)

Hämta hem lame

lame.sourceforge.net/download.php

(I detta exempel laddade jag hem lame-3.99.tar.gz)

Välj source code, packa upp filen, gå in i mappen och kompilera (förutsätter att du befann dig i libsndfile mappen):

cd ../
curl -O 'http://dfn.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.tar.gz'
tar xzvf lame-3.99.tar.gz
cd lame-3.99
./configure --enable-debug  --enable-expopt --with-fileio=sndfile VAR=SNDFILE_LIBS=/usr/local/
make
sudo make install

Steg 3)

Förhoppningsvis har du nu en fungerande LAME 64bits version 3.99. Kontrollera att lame svarar med detta enkla kommando:

lame
(och svaret ska bli..)
LAME 64bits version 3.99 (http://lame.sf.net)

usage: lame [options] <infile> [outfile]

<infile> and/or <outfile> can be "-", which means stdin/stdout.

Try:
"lame --help" for general usage information
or:
"lame --preset help" for information on suggested predefined settings
or:
"lame --longhelp"
or "lame -?" for a complete options list

Kontrollera att lame funkar med någon testfil, gärna AIF för att höra om mp3 filen förblir glitchfri.

lame testfil.aif testfil.mp3

Lycka till!

Copyright © 2024 HEAMUSIC.com, Hans E Andersson. All rights reserved.
heamusic

Login