找回密码
 立即注册→加入我们

QQ登录

只需一步,快速开始

搜索
热搜: 下载 VB C 实现 编写
查看: 5499|回复: 1

MP3转码工具:Lame下载(命令行程序)

[复制链接]
发表于 2014-2-4 00:43:59 | 显示全部楼层 |阅读模式

欢迎访问技术宅的结界,请注册或者登录吧。

您需要 登录 才可以下载或查看,没有账号?立即注册→加入我们

×
Lame主页:
http://www.mp3dev.org/
http://lame.sourceforge.net/

下载链接在1楼底部。

这个是Lame转码工具,是个命令行程序,使用需要有命令行的使用基础。调用:
lame 命令参数 输入文件 -o 输出文件

我们经常需要用到的编码WAV为MP3命令参数是:
设置音质:
-qN   N是音质参数,0到9。0是音质最好,9是编码最快。
这个命令指定了编码的侧重点,你要编码快一些还是音质好一些。
举例:
-q0这个是音质好的)。
-q9个是速度快的)。
这里对音质的影响和位率不一样,它不影响文件大小。
-bN   N是位率。最低8,最高320
这里对音质的影响非常大。位率8的音质不敢恭维,但是文件非常小。位率320的音质最好,但是产生的MP3文件一般都比较大。
一首6分钟的歌,如果位率是320,文件大小应该是16 MB左右。百度音乐下载到的“高品质”一般指的就是位率。

你要是实在拿不定注意,你就直接输-q0 -b320就行了。这个编码的是最好音质。
举例:
编码1.WAV到1.MP3,最好的音质:(最慢编码,最大文件)
lame -q0 -b320 1.WAV -o 1.MP3
编码2.WAV到2.MP3,最快编码,最小文件:(最烂音质)
lame -q9 -b8 2.WAV -o 2.MP3

这里我们用到的解码MP3为WAV的参数是:
--decode
解码很简单,这样的命令:
lame --decode 输入文件 -o 输出文件
举例:
将1.MP3解码为1.WAV:
lame --decode 1.MP3 -o 1.WAV
就可以了。



FAQ:
1、为什么提示文件没找到?
答:长文件名如果路径包含空格,那么你就必须用半角双引号将路径括起来,如下:
把D:\Halo 2 CD\1.WAV编码为D:\Halo 2 CD\1.MP3:
lame -q0 -b320 D:\Halo 2 CD\1.WAV -o D:\Halo 2 CD\1.MP3
这是不行的!
必须写成这样:
lame -q0 -b320 "D:\Halo 2 CD\1.WAV" -o "D:\Halo 2 CD\1.MP3"
这就OK啦。

LAME.GIF
exe下载地址(32位):(版本:3.99.5)
http://www.rarewares.org/files/mp3/lame3.99.5.zip
exe下载地址(64位):(版本:3.99.5)
http://www.rarewares.org/files/mp3/lame3.99.5-64.zip
论坛备份:(版本貌似是3.99)
http://pan.baidu.com/s/1bnqwRrL
源码下载地址:(版本:3.99.5)
http://nchc.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
回复

使用道具 举报

 楼主| 发表于 2014-2-4 00:46:59 | 显示全部楼层

Lame命令行

Exported from Notepad++
Microsoft Windows [版本 6.1.7601] 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。 C:\Users\0xAA55>lame LAME version 3.97 MMX (alpha 2, May 28 2004 06:00:28) (http://www.mp3dev.org/) warning: alpha versions should be used for testing only 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 C:\Users\0xAA55>lame --longhelp LAME version 3.97 MMX (alpha 2, May 28 2004 06:00:28) (http://www.mp3dev.org/) warning: alpha versions should be used for testing only usage: lame [options] <infile> [outfile] <infile> and/or <outfile> can be "-", which means stdin/stdout. RECOMMENDED: lame -h input.wav output.mp3 OPTIONS: Input options: -r input is raw pcm -x force byte-swapping of input -s sfreq sampling frequency of input file (kHz) - default 44.1 kHz --bitwidth w input bit width is w (default 16) --mp1input input file is a MPEG Layer I file --mp2input input file is a MPEG Layer II file --mp3input input file is a MPEG Layer III file --nogap <file1> <file2> <...> gapless encoding for a set of contiguous files --nogapout <dir> output dir for gapless encoding (must precede --nogap) --nogaptags allow the use of VBR tags in gapless encoding Operational options: -m <mode> (s)tereo, (j)oint, (f)orce, (m)ono default is (s) or (j) depending on bitrate force = force ms_stereo on all frames. -a downmix from stereo to mono file for mono encoding --freeformat produce a free format bitstream --decode input=mp3 file, output=wav -t disable writing wav header when using --decode --comp <arg> choose bitrate to achive a compression ratio of <arg> --scale <arg> scale input (multiply PCM data) by <arg> --scale-l <arg> scale channel 0 (left) input (multiply PCM data) by <arg> --scale-r <arg> scale channel 1 (right) input (multiply PCM data) by <arg> --replaygain-fast compute RG fast but slightly inaccurately (default) --replaygain-accurate compute RG more accurately and find the peak sample --noreplaygain disable ReplayGain analysis --clipdetect enable --replaygain-accurate and print a message whether clipping occurs and how far the waveform is from full scale --preset type type must be "medium", "standard", "extreme", "insane", or a value for an average desired bitrate and depending on the value specified, appropriate quality settings will be used. "--preset help" gives more info on these Verbosity: --disptime <arg>print progress report every arg seconds -S don't print progress report, VBR histograms --nohist disable VBR histogram display --silent don't print anything on screen --quiet don't print anything on screen --brief print more useful information --verbose print a lot of useful information Noise shaping & psycho acoustic algorithms: -q <arg> <arg> = 0...9. Default -q 5 -q 0: Highest quality, very slow -q 9: Poor quality, but fast -h Same as -q 2. Recommended. -f Same as -q 7. Fast, ok quality CBR (constant bitrate, the default) options: -b <bitrate> set the bitrate in kbps, default 128 kbps --cbr enforce use of constant bitrate ABR options: --abr <bitrate> specify average bitrate desired (instead of quality) VBR options: -v use variable bitrate (VBR) (--vbr-old) --vbr-old use old variable bitrate (VBR) routine --vbr-new use new variable bitrate (VBR) routine -V n quality setting for VBR. default n=4 0=high quality,bigger files. 9=smaller files -b <bitrate> specify minimum allowed bitrate, default 32 kbps -B <bitrate> specify maximum allowed bitrate, default 320 kbps -F strictly enforce the -b option, for use with players that do not support low bitrate mp3 -t disable writing LAME Tag -T enable and force writing LAME Tag ATH related: --noath turns ATH down to a flat noise floor --athshort ignore GPSYCHO for short blocks, use ATH only --athonly ignore GPSYCHO completely, use ATH only --athtype n selects between different ATH types [0-4] --athlower x lowers ATH by x dB --athaa-type n ATH auto adjust types 1-3, else no adjustment --athaa-loudapprox n n=1 total energy or n=2 equal loudness curve --athaa-sensitivity x activation offset in -/+ dB for ATH auto-adjustment PSY related: --short use short blocks when appropriate --noshort do not use short blocks --allshort use only short blocks --cwlimit <freq> compute tonality up to freq (in kHz) default 8.8717 --notemp disable temporal masking effect --nssafejoint M/S switching criterion --nsmsfix <arg> M/S switching tuning [effective 0-3.5] --interch x adjust inter-channel masking ratio --ns-bass x adjust masking for sfbs 0 - 6 (long) 0 - 5 (short) --ns-alto x adjust masking for sfbs 7 - 13 (long) 6 - 10 (short) --ns-treble x adjust masking for sfbs 14 - 21 (long) 11 - 12 (short) --ns-sfb21 x change ns-treble by x dB for sfb21 --shortthreshold x,y short block switching threshold, x for L/R/M channel, y for S channel Noise Shaping related: --substep n use pseudo substep noise shaping method types 0-2 experimental switches: -X n[,m] selects between different noise measurements n for long block, m for short. if m is omitted, m = n -Y lets LAME ignore noise in sfb21, like in CBR -Z [n] toggles the scalefac-scale and subblock gain feature on if n is set and minus, only scalefac-scale is enabled MP3 header/stream options: -e <emp> de-emphasis n/5/c (obsolete) -c mark as copyright -o mark as non-original -p error protection. adds 16 bit checksum to every frame (the checksum is computed correctly) --nores disable the bit reservoir --strictly-enforce-ISO comply as much as possible to ISO MPEG spec Filter options: -k keep ALL frequencies (disables all filters), Can cause ringing and twinkling --lowpass <freq> frequency(kHz), lowpass filter cutoff above freq --lowpass-width <freq> frequency(kHz) - default 15% of lowpass freq --highpass <freq> frequency(kHz), highpass filter cutoff below freq --highpass-width <freq> frequency(kHz) - default 15% of highpass freq --resample <sfreq> sampling frequency of output file(kHz)- default=automatic ID3 tag options: --tt <title> audio/song title (max 30 chars for version 1 tag) --ta <artist> audio/song artist (max 30 chars for version 1 tag) --tl <album> audio/song album (max 30 chars for version 1 tag) --ty <year> audio/song year of issue (1 to 9999) --tc <comment> user-defined text (max 30 chars for v1 tag, 28 for v1.1) --tn <track> audio/song track number (1 to 255, creates v1.1 tag) --tg <genre> audio/song genre (name or number in list) --add-id3v2 force addition of version 2 tag --id3v1-only add only a version 1 tag --id3v2-only add only a version 2 tag --space-id3v1 pad version 1 tag with spaces instead of nulls --pad-id3v2 pad version 2 tag with extra 128 bytes --genre-list print alphabetically sorted ID3 genre list and exit --ignore-tag-errors ignore errors in values passed for tags Note: A version 2 tag will NOT be added unless one of the input fields won't fit in a version 1 tag (e.g. the title string is longer than 30 characters), or the '--add-id3v2' or '--id3v2-only' options are used, or output is redirected to stdout. MS-Windows-specific options: --priority <type> sets the process priority: 0,1 = Low priority (IDLE_PRIORITY_CLASS) 2 = normal priority (NORMAL_PRIORITY_CLASS, defau lt) 3,4 = High priority (HIGH_PRIORITY_CLASS)) Note: Calling '--priority' without a parameter will select priority 0. Platform specific: --noasm <instructions> disable assembly optimizations for mmx/3dnow/sse MPEG-1 layer III sample frequencies (kHz): 32 48 44.1 bitrates (kbps): 32 40 48 56 64 80 96 112 128 160 192 224 256 320 MPEG-2 layer III sample frequencies (kHz): 16 24 22.05 bitrates (kbps): 8 16 24 32 40 48 56 64 80 96 112 128 144 160 MPEG-2.5 layer III sample frequencies (kHz): 8 12 11.025 bitrates (kbps): 8 16 24 32 40 48 56 64 80 96 112 128 144 160 C:\Users\0xAA55>
回复 赞! 靠!

使用道具 举报

本版积分规则

QQ|Archiver|小黑屋|技术宅的结界 ( 滇ICP备16008837号 )|网站地图

GMT+8, 2024-11-21 21:20 , Processed in 0.034948 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表