有没有办法用SoX修剪文件的结尾,在几毫秒内,我试过这个:
sox tracks\5_7.mp3 ntracks\05_7.mp3 trim 2 2.195
Run Code Online (Sandbox Code Playgroud)
但是,它只是说End position is after expected end of audio
即使文件实际上那么长.
因此,我试图让这首歌长达2.000秒,而不是2.195,我也是这样做的600多个文件,所以需要从命令行完成.
继承我的警告:
sox WARN mp3: MAD lost sync"(this always happens, means nothing)
sox WARN trim: Last 1 position(s) not reached (audio shorter than expected)
sox WARN sox: 'tracks\01_1.mp3' balancing clipped 3 samples; decrease volume?
Run Code Online (Sandbox Code Playgroud)
该音频文件为"00:00:02.19".
输入命令行的行是:
sox -v3 tracks\01_1.mp3 ntracks\01_1.mp3 trim 2 0.19 pause
Run Code Online (Sandbox Code Playgroud)
这是我详细的开始:
D:\Stuff\Habbo trax maker\trax maker\mp3support>sox -V3 tracks\01_1.mp3 ntracks\
01_1.mp3 trim 2 0.19
sox: SoX v14.4.0
Input File : 'tracks\01_1.mp3'
Channels : 1
Sample Rate : 44100
Precision : 16-bit
Duration : 00:00:02.19 = 96755 samples = 164.549 CDDA sectors
File Size : 17.6k
Bit Rate : 64.0k
Sample Encoding: MPEG audio (layer I, II or III)
sox INFO sox: Overwriting `ntracks\01_1.mp3'
sox INFO mp3: using MP3 encoding defaults
Output File : 'ntracks\01_1.mp3'
Channels : 1
Sample Rate : 44100
Precision : 24-bit
Sample Encoding: MPEG audio (layer I, II or III)
Comment : 'Processed by SoX'
sox INFO sox: effects chain: input 44100Hz 1 channels
sox INFO sox: effects chain: trim 44100Hz 1 channels
sox INFO sox: effects chain: output 44100Hz 1 channels
sox WARN mp3: MAD lost sync
sox WARN trim: Last 1 position(s) not reached (audio shorter than expected).
Run Code Online (Sandbox Code Playgroud)
Tho*_*hor 22
如果要以毫秒精度修剪,请指定它:
sox in.mp3 out.mp3 trim 2 0.195
Run Code Online (Sandbox Code Playgroud)
节省了195毫秒与2秒的偏移in.mp3
到out.mp3
.
如果你只想要文件的前两秒使用如下修剪:
sox in.mp3 out.mp3 trim 0 2
Run Code Online (Sandbox Code Playgroud)
如果你想跳过文件的前两秒,请使用如下修剪:
sox in.mp3 out.mp3 trim 2
Run Code Online (Sandbox Code Playgroud)
如果你想从文件末尾修剪195毫秒,请使用gerald的答案.
摘自手册:
trim start [length|=end]
The optional length parameter gives the length of audio to output after the
start sample and is thus used to trim off the end of the audio.
Alternatively, an absolute end location can be given by preceding it with
an equals sign. Using a value of 0 for the start parameter will allow trimming
off the end only.
Run Code Online (Sandbox Code Playgroud)
小智 8
您是否尝试过使用这样的反向命令:
sox tracks\5_7.mp3 ntracks\05_7.mp3 reverse trim 0.195 reverse
Run Code Online (Sandbox Code Playgroud)
这应该丢弃文件的最后0.195毫秒(它适用于我).
你应该用这样来修剪毫秒
trim 26.26 =32.3245678
Run Code Online (Sandbox Code Playgroud)
这意味着它将修剪26.26秒,精确到32.3245678秒
这将为您提供准确的结果
使用此=
选项,我们需要给出结束时间而不是前面的持续时间=
我希望这能解决你的问题