Procedure TForm1.NormalizeAudio(Idx: Integer);
Var
...
Begin
...
AProcess := TProcess.Create(Nil);
Try
AProcess.InheritHandles := False;
AProcess.Options := [];
AProcess.ShowWindow := swoShow;
// Copy default environment variables including DISPLAY variable for GUI application to work
For I := 1 to GetEnvironmentVariableCount Do
AProcess.Environment.Add(GetEnvironmentString(I));
AProcess.Executable := '/bin/bash';
AProcess.Parameters.Add('-c');
AProcess.Parameters.Add('ffmpeg -y -i "' + SongPath^.OldPath + '" -filter:a loudnorm "' + SongPath^.TempSongPath + '"');
AProcess.Execute;
Finally
AProcess.Free;
End;
For Num:=0 To 4294967295 Do
Begin
If (AProcess.Active = True) Then Sleep(10) Else Begin ConvertAudio(QueueHandler^.CurrentIndex); NormalizeAudioUnset End;
Application.ProcessMessages;
End;
End;