cmusphinx / sphinx4

Pure Java speech recognition library
cmusphinx.sourceforge.net
Other
1.4k stars 587 forks source link

fix time parameter of Speech Signals #59

Open d4ksn opened 8 years ago

d4ksn commented 8 years ago

Hello, I found the time statistics of the SpeedTracker is sometimes incorrect, with "This Time Audio: XX.Xs" being a very big number (actually it's a timestamp counting from 1970-01-01). After tracing the code, I have found some issues regarding the time parameter of SpeechStartSignal/SpeechEndSignal, and fixed it by myself.

  1. I think SpeechEndSignal should be constructed with a time parameter relative to the audio time, just like in line 184 in this file. Otherwise, the time will be set to a system timestamp, which will cause the above issue.
  2. In the SpeechStartSignal constructor, the parameter is meant to be in millisecond (just like "cdata.getCollectTime()" and "speechLeader"). However, "startSpeechFrames" is counted in frame (which is "startSpeechTime"/10), so I have also changed this.

just some of my suggestions, I hope you would consider it, Thanks!

nshmyrev commented 8 years ago

Thanks for the pull request. Overall, I'm not quite happy with the current design of the frontend, its so painful to track all those signals. We will probably refactor it altogether.