Google

Wednesday, November 15, 2006

Text To Speech Using Python for S60

Recently, I came across a very interesting post to symbianexample.com by Artem http://symbianexample.com/texttospeech. 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: http://www2.cs.uh.edu/~nikhilv/PyS60/ttsplayer.zip

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!

6 Comments:

Anonymous Anonymous 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 paposoft 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 thanida said...

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

11:54 PM  
Blogger thanida said...

useful information tnx a lot for your post จีคลับ.

10:13 PM  
Blogger casinoxo said...

แสนสนุกไปกับเว็บดูหนังออนไลน์ Seventeen 17 วัยเปลี่ยนโลก (2019) ที่ดีที่สุดในประเทศไทยไทย ดูหนังฟรีไม่มีจำกัด
https://www.doonung1234.com/

7:42 AM  

Post a Comment

<< Home