first_step.cpp

First step in BSAPI. This example shows how work with an instance of an class. It calls BSAPICreateInstance() to request instance of speech recognizer, then a phoneme recognizer is initialized using a config file, speech form one file is transcribed to phonemes and at the end the instance is released.

00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include "bsapi.h"
00004 
00005 main()
00006 {
00007   
00008   SSpeechRecI *psrec = static_cast<SSpeechRecI *>(BSAPICreateInstance(SIID_SPEECHREC));
00009   if(!psrec)
00010   {
00011     fprintf(stderr, "ERROR: Memory allocation error\n");
00012     exit(1);
00013   }  
00014 
00015   if(psrec->Init("PHN_HU_SPDAT_LCRC_N1500/config"))
00016     exit(1);
00017 
00018   if(psrec->ProcessFile(SSpeechRecI::dfWaveform, SSpeechRecI::dfHypothesis, "inpt.raw", "output.lab")
00019     exit(1);
00020 
00021   psrec->Release();
00022 
00023   return 0;
00024 }

Generated on Wed Jul 15 10:10:04 2009 for BSAPI by  doxygen 1.4.7