sphinx4 - Using streamDataSource -
i tried latticedemo.java. and, result shown in example result. example using "audiofiledatasource" voice data (10001-90210-01803.wav). trying recognize voice data in different way using streamdatasource.
but, different result. hear idea.
the following steps took:
get byte data 10001-90210-01803.wav following code
file f = new file(file); bytearrayoutputstream out = new bytearrayoutputstream(); bufferedinputstream in; try { in = new bufferedinputstream(new fileinputstream(f)); return bytestreams.tobytearray(in); } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); }
then, put byte data called "data" bytearrayinputstream following
streamdatasource datasource = (streamdatasource) cm.lookup("streamdatasource"); bytearrayinputstream st = new bytearrayinputstream(data); datasource.setinputstream(st, "main stream");
actually, when use "setinputstream" function, second argument(i.e. "main stream") has special meaning? cannot see why argument needed.
the configuration streamdatasource following:
<component name="streamdatasource" type="edu.cmu.sphinx.frontend.util.streamdatasource"> <property name="samplerate" value="16000" /> <property name="bigendiandata" value="false" /> </component>
the output is
loading... 17:48:01.941 warning dictionary missing word: <unk> 17:48:02.543 warning dictionary missing word: <unk> <s> i. </s> <s> i. <sil> </s> <s> i. a. </s> <s> i. </s> <s> </s> <s> </s> <s> <sil> </s> <s> a. </s> <s> high </s> <s> </s> <s> </s> <s> i. </s> <s> i </s> <s> i. </s> <s> i. </s> <s> i. i. </s> <s> high </s> <s> higher </s> <s> tight </s> <s> right </s> <s> wright </s> heard:
regards
actually, when use "setinputstream" function, second argument(i.e. "main stream") has special meaning? cannot see why argument needed.
no, argument unused , kept compatibility
<property name="bigendiandata" value="false" />
property name bigendiandata, not bigendiandata. please make sure using latest sphinx4, it's recommended checkout latest trunk subversion.
Comments
Post a Comment