suppose I have MP3 of around 1 minute duration and increase its duration longer.Duration can be any.
I want to randomly add N seconds of silence to that audio.
I can generate the silence like below
ffmpeg -f lavfi -i anullsrc=r=44100:cl=mono -t <seconds> -q:a 9 -acodec libmp3lame out.mp3
And I can insert silence to audio like below
ffmpeg -i in.wav -filter_complex "anullsrc,atrim=0:4[s];[0]atrim=0:14[a];[0]atrim=14,asetpts=N/SR/TB[b];[a][s][b]concat=3:v=0:a=1" out.wav
Is there anyway to insert silence at multiple areas.With php I can generate random time to insert based on 60 seconds audio like below.
$arr = [];
$arr[3] = 2; //here 3 is original audio insert time and 2 is the duration of silence
$arr[6] = 3; //here 6 is original audio insert time and 3 is the duration of silence
$arr[10] = 1;
$arr[12] = 3;
Now I want to insert silence between seconds based on above array like
2 seconds silence at 3rd second
3 seconds silence at 6th second
1 second silence at 10th second
and son on..