This page was last modified 03:55, 1 July 2008.
Text to speech in symbian 2nd and 3rd edition phones
From Forum Nokia Wiki
Text to Speech in symbian 2nd and 3rd edition phones
Latest S60 devices from Nokia (starting from N70 and N90) include speaker independent name dialing (SIND) and enhanced voice commands. You don't have to train your phone voice dialing anymore. To make a call you simply need to push the voice key and say the name from the phonebook. SIND feature is closed for third party developers. However,there is a shortcut for using the Text-to-Speech part of SIND. You can make your phone synthesize a piece of arbitrary text by passing a specially formed descriptor to the CMdaAudioPlayerUtility.
iPlayer->OpenDesL( _L8( "(tts)Say this" ) );
The speech quality is too low for synthesizing emails or even single sentences, but is sufficient for pronouncing one-two words expected by the user. It can really be used in your program for synthesizing names, "left", "right", maybe addresses. Note that this code example will work on hardware only. It can be compiled also for WINS, but on emulator the playback requests will fail with KErrNotSupported. Apparently the text-to-speech libraries are not included into the SDK distribution.
// Prefix telling the audio utility that TTS should be used _LIT( KTtsPrefix, "(tts)" ); void CTtsPlayer::PlayTextL( TDesC& aText ) { __ASSERT_ALWAYS( iPlaybackInProgress == EFalse, User::Leave( KErrNotReady ) ); HBufC8* playableText = HBufC8::NewLC( aText.Length() + KTtsPrefix().Length() ); playableText->Des().Append( KTtsPrefix ); playableText->Des().Append( aText ); iPlayer->OpenDesL( *playableText ); iPlaybackInProgress = ETrue; iWaiter->Start(); // At this point playback is already completed or failed User::LeaveIfError( iErr ); CleanupStack::PopAndDestroy( playableText ); } void CTtsPlayer::MapcInitComplete( TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/ ) { iErr = aError; if( aError != KErrNone ) { iPlaybackInProgress = EFalse; // Let the paused PlayTextL complete iWaiter->AsyncStop(); } else { iPlayer->Play(); } } void CTtsPlayer::MapcPlayComplete( TInt aError ) { iErr = aError; iPlaybackInProgress = EFalse; // Let the paused PlayTextL complete iWaiter->AsyncStop(); }
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Symbian SDK vervions supported by Carbide | er_benji | Carbide.c++ and CodeWarrior Tools | 3 | 2006-07-17 08:29 |
| how to get IMEI in Series60 3rd edition ? | ahmed abdelaziz | General Symbian C++ | 2 | 2006-08-10 15:17 |
| How to get the system capabilities | harry_zhang | General Symbian C++ | 5 | 2006-08-06 18:07 |
| EasyLock_S60_V12 | runtings | General Symbian C++ | 1 | 2006-12-28 16:22 |
| text to speech conversion - reg | sugansivam | Mobile Java Networking & Messaging & Security | 3 | 2007-01-17 09:46 |
