Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Codewarrior Symbian > Speech Recognit...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 141 of 155
Post > Topic >>

Speech Recognition Utility CreateLexicon

by =?ISO-8859-1?Q?Martin_G=E4ckler?= <martin@[EMAIL PROTECTED] > Dec 21, 2006 at 11:10 AM

Hello again,

I'm trying to write an application that uses the speech recognition API. 
When I call CreateLexicon I get an ErrorCode -14 (Object in use by 
another application). But there is no other application running in the 
emulator. How can I fix the problem? Here is the part of my source that 
is relevant:

TInt				errCode;
TUint16				buffer[1024];
TPtr				ptr( buffer, 0, 1024 );
TPtrC				errText;
RArray<TLexiconID>	lexIds;
CAknInformationNote	*informationNote  = new ( ELeave )
CAknInformationNote;
CErrorUI			*errBox = CErrorUI::NewL();

iEikonEnv ->InfoMsg( _L("Speech") );

speech = CSpeechRecognitionUtility::NewL( speechObserver, KUidtest );
if( speech )
{
     errCode = speech->GetAllLexiconIDs( lexIds );
     if( errCode != KErrNone )
         errText.Set( _L("Lex Error") );
     if( errCode == KErrNone )
     {
         if( lexIds.Count() == 0 )
         {
             errCode = speech->CreateLexicon( lexiconID );
             if( errCode == KErrNone )
             {
                 errCode = speech->CommitChanges();
                 if( errCode != KErrNone )
                     errText.Set( _L("Changes not saved") );
             }
             else
                 errText.Set( _L("Lexicon not created") );
         }
         else
             lexiconID = lexIds[0];
     }
     if( errCode == KErrNone )
     {
         ptr.Format( _L("%d lexicons"), lexIds.Count() );
         informationNote->ExecuteLD( ptr );
     }

     else

     {

         errBox->ShowGlobalErrorQueryL( errCode );
         ptr.Format( _L("%d: %s"), errCode, errText.Ptr() );
         informationNote->ExecuteLD( ptr );
     }
}

else

     informationNote->ExecuteLD( _L("Speech not loaded") );

Thanks in advance

Martin

-- 
Firma/Company:                                              CRESD GmbH
Phone: +49-89-65 30 95 63                      Fax: +49-89-65 30 95 64
WWW:                                               http://www.cresd.de
S-Mail:                                Freibadstr. 14, D-81543 München
PGP-Key:                            http://www.cresd.de/edv/pgpkey.txt
Open BC (Einladung)            http://www.openbc.com/go/invita/4561755




 1 Posts in Topic:
Speech Recognition Utility CreateLexicon
=?ISO-8859-1?Q?Martin_G=E  2006-12-21 11:10:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 20:22:18 CDT 2008.