From 7b30d3b525ba9b744ea175a0575c8fbdbce81146 Mon Sep 17 00:00:00 2001 From: d4ksn Date: Wed, 27 Jul 2016 19:26:06 +0800 Subject: [PATCH] Fix time paramater of the SpeechSignal Fix minor bugs regarding to the time paramater of the SpeechStartSignal/SpeechEndSignal --- .../java/edu/cmu/sphinx/frontend/endpoint/SpeechMarker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx4-core/src/main/java/edu/cmu/sphinx/frontend/endpoint/SpeechMarker.java b/sphinx4-core/src/main/java/edu/cmu/sphinx/frontend/endpoint/SpeechMarker.java index 0b5c23250..75f2986d3 100644 --- a/sphinx4-core/src/main/java/edu/cmu/sphinx/frontend/endpoint/SpeechMarker.java +++ b/sphinx4-core/src/main/java/edu/cmu/sphinx/frontend/endpoint/SpeechMarker.java @@ -146,7 +146,7 @@ public Data getData() throws DataProcessingException { if (data instanceof DataEndSignal) { if (inSpeech) { - outputQueue.add(new SpeechEndSignal()); + outputQueue.add(new SpeechEndSignal(((DataEndSignal)data).getDuration())); } outputQueue.add(data); break; @@ -174,7 +174,7 @@ public Data getData() throws DataProcessingException { if (!inSpeech && speechCount == startSpeechFrames) { inSpeech = true; - outputQueue.add(new SpeechStartSignal(cdata.getCollectTime() - speechLeader - startSpeechFrames)); + outputQueue.add(new SpeechStartSignal(cdata.getCollectTime() - speechLeader - startSpeechTime)); outputQueue.addAll(inputQueue.subList( Math.max(0, inputQueue.size() - startSpeechFrames - speechLeaderFrames), inputQueue.size())); inputQueue.clear();