I'd like to split mp3 Files at a specific range by silence. To do that I have the following script, but don't know how to stop and restart the search function:
$minDuraton = 180
$maxDuraton = 480
$paramDB = -42
$w_paramDB = $paramDB
$silparam = [string]$w_paramDB+"dB:d=0.2"
C:\ffmpeg\bin\ffmpeg.exe -v warning -i "C:\mp3\test.mp3" -af silencedetect=$silparam,ametadata=mode=print:file=-:key=lavfi.silence_start -vn -sn -f s16le -y D:\Mailbox\09_Tools\PS_Scripte\mp3\Tmp_silents_part.txt|
%{ if ($_ -match "start"){
$i++
$text,$time = $_ -split "="
$p_Duration = $time - $StartPart
if($p_Duration -gt ($maxDuraton +10)){
# Stop ffmepg and restart with new parameter
##### -please help- #####
# editing Parameter
$w_paramDB = [INT]($w_paramDB * 1,10)
}
elseif($p_Duration -ge $minDuraton ){
$null = $PartArr.Add($time)
$StartPart = $time
}
}
}
$PartArr
$i
$segments = ($PartArr) -join "," #PartArr | Join-String -Separator ','
$segmentsC:
C:\ffmpeg\bin\ffmpeg.exe -i "C:\mp3\test.mp3" -f segment -segment_times $segments "C:\mp3\output_silc_%03d.mp3"
THE ACTUAL SCRIPT:
The Output Error is:
-> Don't know where the error is...