.setLanguageModelPath("resource:/edu/cmu/sphinx/models/language/en-us.lm.dmp");
StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(
configuration);
TimeFrame t;
SpeechResult result;
for (SpeakerCluster spk : speakers) {
Stats stats = recognizer.createStats(1);
ArrayList<Segment> segments = spk.getSpeakerIntervals();
for (Segment s : segments) {
long startTime = s.getStartTime();
long endTime = s.getStartTime() + s.getLength();
t = new TimeFrame(startTime, endTime);
recognizer.startRecognition(url.openStream(), t);
while ((result = recognizer.getResult()) != null) {
stats.collect(result);
}
recognizer.stopRecognition();
}
Transform profile;
// Create the Transformation
profile = stats.createTransform();
recognizer.setTransform(profile);
for (Segment seg : segments) {
long startTime = seg.getStartTime();
long endTime = seg.getStartTime() + seg.getLength();
t = new TimeFrame(startTime, endTime);
// Decode again with updated SpeakerProfile
recognizer.startRecognition(url.openStream(), t);
while ((result = recognizer.getResult()) != null) {
System.out.format("Hypothesis: %s\n",