-
Notifications
You must be signed in to change notification settings - Fork 2
/
Audio.java
31 lines (25 loc) · 1015 Bytes
/
Audio.java
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
import LCS.*;
import TTS.*;
import STT.*;
import java.beans.PropertyVetoException;
import java.io.IOException;
import javax.speech.AudioException;
import javax.speech.EngineException;
import javax.speech.EngineStateError;
public class Audio {
public static void main(String[] args) throws EngineException,
AudioException, IllegalArgumentException, InterruptedException,
EngineStateError, PropertyVetoException, IOException{
SpeechToText speechtotext = new SpeechToText();
String audio1 = speechtotext.SpeechToTextConverter("C:\\compassionate.wav");
String audio2 = speechtotext.SpeechToTextConverter("C:\\community.wav");
LCS lcs = new LCS();
char[] subSeq = lcs.initializeLCS(audio1, audio2);
System.out.println(subSeq);
String speak = new String(subSeq);
TextToSpeech result = new TextToSpeech();
result.init("kevin16");
result.doSpeak(speak);
result.terminate();
}
}