Wednesday, November 15, 2006

Text To Speech Using Python for S60

Recently, I came across a very interesting post to by Artem This article publishes a 'hidden' S60 feature - An MMF plugin that is able to play text!! This plugin apparently exists only for S60 2.8+ phones. I have not been able to confirm that.

Imagine your program synthesizing any text... Who would not like their programs to speak intelligently to the user? I for one would for sure!!

Now, I am a die-hard PyS60 fan... I jumped on this opportunity to enable PyS60 scripts with TTS. The result was a Python extension, _ttsplayer.pyd.

_ttsplayer.pyd is a C++ Python extension DLL. This DLL wraps the CTtsPlayer class provided by Artem in his original post. The extension provides only one method:

playtext(text) # text is unicode

The usage of this module is very simple:

import ttsplayer
ttsplayer.playtext(u'Hello Mr. Anderson')

As per Artem's article, this MMF plugin synthesizes the speech using Speaker INDependent (SIND) framework. As you will find out when you start using this module, the quality of the generated speech is poor. Although, in more recent S60 devices (such as N75 - cool phone! oh sorry, cool computer!) we see evidence of a High Quality TTS framework. I am not sure whether SIND framework will eventually merge with this High Quality TTS framework. I can only hope that it does!

The package is published here:

The package contains the following components:
  • Source package - CTtsPlayer class and Python module wrapper, MMP file, PKG file, bld.inf file. These file allow you to create PYD extension module using your favorite S60 SDK.
  • Python module - This module wraps the C++ extension DLL loading etc.
  • Example python script - To show usage in a PyS60 script.
  • Unsigned SIS file S60 3.0 - You can sign this SIS using your favorite certificate and install it if you do not want to go through the trouble of compilation.

I hope you like this little extension module. There are countless uses for this module. One can imagine a PyS60 script that gets directions from one location to another (see Rantings of a Snake Charmer IV) and dictates the direction steps to the user using TTS!

Thanks to Artem for finding this hidden feature in S60!


Blogger cyke64 said...

hello ,

I have been more faster than you !
I have already made this little extension for PyS60 since 7 Nov 2006 (announced on Python Forum) ... I named it : Speechy.pyd
Are you reading from time to time the PyS60 Nokia Forum ???

links :

2:21 AM  
Anonymous Artem said...

Wow, I had no idea that somebody managed to wrap the text-to-sppech into Python. Great job, guys, whoever was the first one to do it! :)

And by the way, Nikhil, SIND stays for Speaker Independent Name Dialing ;)

3:19 AM  
Blogger Ade said...

how about s60 2nd edition? are there any tts application for nokia 6600? i want to develop for my nokia 6600 using python...

1:42 AM  
Blogger SzeZo said...

Certificate expired error using E71 - can You please re-release the .sis file?

1:55 AM  
Blogger vaiybora said...

Hello everybody.
I really like you post.
I would like to share page collection with you!
if you want to play game online casino please click on this post comment.Thank you.
Gclub จีคลับ
golden slot casino

1:54 AM  
Blogger Goldenslot said...


9:18 PM  
Blogger โชติ ธรีะวิท said...

Actually such burnouts are regular for me. I will use your tricks .
Thanks for motivation

11:54 PM  

Post a Comment

Links to this post:

Create a Link

<< Home