Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing streamDataSource
    text
    copied!<p>I tried LatticeDemo.java. And, I could get the result as shown in the example result. This example is using "AudioFileDataSource" for voice data (10001-90210-01803.wav). I am trying to recognize this voice data in a different way using StreamDataSource.</p> <p>But, I get a different result. I would like to hear any idea.</p> <p>The following is the steps I took:</p> <ol> <li><p>get Byte data from 10001-90210-01803.wav by the following code</p> <pre><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(); } </code></pre></li> <li><p>Then, just put this byte data called "data" into ByteArrayInputStream like the following</p> <p>StreamDataSource dataSource = (StreamDataSource) cm.lookup("streamDataSource"); ByteArrayInputStream st = new ByteArrayInputStream(data); dataSource.setInputStream(st, "Main Stream");</p></li> </ol> <p>Actually, when we use "setInputStream" function, the second argument(i.e. "Main Stream") has special meaning? I cannot see why this argument is needed.</p> <p>The configuration for streamDataSource is the following:</p> <p>&lt;component name="streamDataSource" type="edu.cmu.sphinx.frontend.util.StreamDataSource"&gt; &lt;property name="sampleRate" value="16000" /&gt; &lt;property name="bigendianData" value="false" /&gt; &lt;/component&gt;</p> <p>The output is</p> <pre><code>Loading... 17:48:01.941 WARNING dictionary Missing word: &lt;unk&gt; 17:48:02.543 WARNING dictionary Missing word: &lt;unk&gt; &lt;s&gt; i. &lt;/s&gt; &lt;s&gt; i. &lt;sil&gt; &lt;/s&gt; &lt;s&gt; i. a. &lt;/s&gt; &lt;s&gt; i. a &lt;/s&gt; &lt;s&gt; i &lt;/s&gt; &lt;s&gt; i a &lt;/s&gt; &lt;s&gt; i &lt;sil&gt; &lt;/s&gt; &lt;s&gt; i a. &lt;/s&gt; &lt;s&gt; high a &lt;/s&gt; &lt;s&gt; i &lt;/s&gt; &lt;s&gt; a i &lt;/s&gt; &lt;s&gt; a i. &lt;/s&gt; &lt;s&gt; i i &lt;/s&gt; &lt;s&gt; i i. &lt;/s&gt; &lt;s&gt; i. &lt;/s&gt; &lt;s&gt; i. i. &lt;/s&gt; &lt;s&gt; high &lt;/s&gt; &lt;s&gt; higher &lt;/s&gt; &lt;s&gt; tight &lt;/s&gt; &lt;s&gt; right &lt;/s&gt; &lt;s&gt; wright &lt;/s&gt; I heard: i </code></pre> <p>Regards</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload