1 | import edu.cmu.sphinx.util.TimeFrame; |
2 | import edu.cmu.sphinx.api.AbstractSpeechRecognizer; |
3 | import edu.cmu.sphinx.api.SpeechResult; |
4 | |
5 | sclass StreamSpeechRecognizer2 extends AbstractSpeechRecognizer {
|
6 | bool allocated; |
7 | |
8 | *(Configuration configuration) throws IOException {
|
9 | super(configuration); |
10 | } |
11 | |
12 | public void startRecognition(InputStream stream) {
|
13 | startRecognition(stream, TimeFrame.INFINITE); |
14 | } |
15 | |
16 | public void startRecognition(InputStream stream, TimeFrame timeFrame) {
|
17 | if (!allocated) {
|
18 | recognizer.allocate(); |
19 | allocated = true; |
20 | } |
21 | context.setSpeechSource(stream, timeFrame); |
22 | } |
23 | |
24 | public void stopRecognition() {}
|
25 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1007038 |
| Snippet name: | StreamSpeechRecognizer2 |
| Eternal ID of this version: | #1007038/1 |
| Text MD5: | bce96dc864705221addde81622f15b70 |
| Author: | stefan |
| Category: | javax / speech recognition |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-02-26 00:20:52 |
| Source code size: | 679 bytes / 25 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 809 / 1393 |
| Referenced in: | [show references] |