-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplace.java
More file actions
41 lines (29 loc) · 1.06 KB
/
replace.java
File metadata and controls
41 lines (29 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package VAMIX;
import java.io.IOException;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
public class replace extends SwingWorker<Void, Integer>{
private String openPathInputV;
private String openPathInputA;
private String savePathOutput;
//Store file locations
public replace(String openPathInputV, String openPathInputA, String savePathOutput){
this.openPathInputV = openPathInputV;
this.openPathInputA = openPathInputA;
this.savePathOutput = savePathOutput;
}
public void replaceAudio() throws IOException{
String cmd="avconv -i "+this.openPathInputV+" -i "+this.openPathInputA+" -c:v copy -c:a copy -map 1:0 -map 0:0 "+this.savePathOutput;
ProcessBuilder builder2 = new ProcessBuilder("/bin/bash", "-c", cmd);
builder2.start();
}
protected Void doInBackground() throws Exception {
this.replaceAudio();
return null;
}
protected void done(){
JFrame messageFrame = new JFrame();
JOptionPane.showMessageDialog(messageFrame, "Finished replacing","VAMIX", JOptionPane.INFORMATION_MESSAGE);
}
}