diff --git a/SLAM/Form1.vb b/SLAM/Form1.vb index bb18534..55f2b53 100644 --- a/SLAM/Form1.vb +++ b/SLAM/Form1.vb @@ -165,7 +165,12 @@ Public Class Form1 Dim convert As New FFMpegConverter() convert.ExtractFFmpeg() - Dim command As String = String.Format("-i ""{0}"" -f wav -flags bitexact -map_metadata -1 -vn -acodec pcm_s16le -ar {1} -ac {2} -ss {3} -t {4} -af ""volume={5}"" ""{6}""", Path.GetFullPath(inpath), samplerate, channels, starttrim, length, volume, Path.GetFullPath(outpath)) + Dim trimstring As String + If length > 0 Then + trimstring = String.Format("-ss {0} -t {1} ", starttrim, length) + End If + + Dim command As String = String.Format("-i ""{0}"" -f wav -flags bitexact -map_metadata -1 -vn -acodec pcm_s16le -ar {1} -ac {2} {3}-af ""volume={4}"" ""{5}""", Path.GetFullPath(inpath), samplerate, channels, trimstring, volume, Path.GetFullPath(outpath)) convert.Invoke(command) End Sub