コード例 #1
0
        /**
         * /// Decodes the batch of audio files
         */
        public void decode(String batchFile)
        {
            BatchItem batchItem;
            int       count = 0;

            try {
                recognizer.Allocate();
                setBatchFile(batchFile);

                batchManager.Start();
                this.LogInfo("BatchDecoder: decoding files in "
                             + batchManager.Filename);

                while (count < utteranceId &&
                       (batchItem = batchManager.GetNextItem()) != null)
                {
                    setInputStream(batchItem.Filename);
                    Result result = recognizer.Recognize(batchItem.Transcript);
                    this.LogInfo("File  : " + batchItem.Filename);
                    this.LogInfo("Result: " + result);
                    count++;
                }
                batchManager.Stop();
                recognizer.Deallocate();
            } catch (IOException io)
            {
                this.LogInfo("I/O error during decoding: " + io.Message);
                throw io;
            }
            this.LogInfo("BatchDecoder: " + count + " files decoded");
        }