web-dev-qa-db-ja.com

ミリ秒単位のSoxでオーディオファイルをトリミングする

SoXでファイルの終わりをミリ秒単位でトリミングする方法はありますか?私はこれを試しました:

sox tracks\5_7.mp3 ntracks\05_7.mp3 trim 2 2.195

しかし、それはただEnd position is after expected end of audioファイルは実際にはそれほど長いですが。

したがって、この曲を2.195秒ではなく2.000秒にしようとすると、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?

このオーディオファイルは「00:00:02.19」になります。

コマンドラインに入力された行は次のとおりです。

sox -v3 tracks\01_1.mp3 ntracks\01_1.mp3 trim 2 0.19 pause

これが私の冗長なスタートです:

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).
15
heath sargent

ミリ秒の精度でトリミングする場合は、それを指定します。

sox in.mp3 out.mp3 trim 2 0.195

in.mp3からout.mp3への2秒のオフセットで195ミリ秒を節約します。

ファイルの最初の2秒間だけが必要な場合は、次のようにトリムを使用します。

sox in.mp3 out.mp3 trim 0 2

ファイルの最初の2秒間をスキップする場合は、次のようにトリムを使用します。

sox in.mp3 out.mp3 trim 2

ファイルの最後から195ミリ秒をトリミングする場合は、 gerald's を使用します。

マニュアルからの抜粋:

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.
22
Thor

このようなreverseコマンドを使ってみましたか:

sox tracks\5_7.mp3 ntracks\05_7.mp3 reverse trim 0.195 reverse

これにより、ファイルの最後の0.195ミリ秒が破棄されます(私にとっては機能します)。

8
gerald

ミリ秒単位でトリミングするには、このように使用する必要があります

trim 26.26 =32.3245678 

これは、26.26秒を正確に最大32.3245678秒にトリミングすることを意味します

これにより、正確な結果が得られます

この=オプションを使用すると、=の前の期間の代わりに時間の終わりを指定する必要があります

これで問題が解決することを願っています

7
Ram chittala