Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


Speech library for the DEVICE!


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-30-2007, 02:50 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,219
Awards Showcase
Forum Contributer 
Total Awards: 1
Default Speech library for the DEVICE!

After the deafening silence that accompanied my ControlsExDesktop library lets see if this one gets more interest.

I already did a speech library for the desktop Text To Speech library (desktop only) but that was not portable to the device as it used Microsoft's Speech API that is not available on most devices. So I have (almost literally!) sweated blood for a few days to try to get a sound library on the device. After several false starts I have finally managed to port the flite http://fife.speech.cs.cmu.edu/flite/ open source speech engine to the device. It was was a bit of a messy port but it seems to work fine on my device and has the simplest possible interface to B4PPC.

As it was too large to upload directly Erel kindly accepted it by email and has made it available here :-
http://www.basic4ppc.com/files/fliteDevice.zip
Reply With Quote
  #2 (permalink)  
Old 11-30-2007, 04:10 PM
Senior Member
 
Join Date: May 2007
Posts: 150
Awards Showcase
Competition Winner 
Total Awards: 1
Default voice

Amazing, Agraham !

I tried it and it works !

Do you have any means of control like pitch or volume ?

I may find use for it in my off-road navigation program, as instructions to follow a route.
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #3 (permalink)  
Old 11-30-2007, 04:25 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,219
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by derez View Post
Do you have any means of control like pitch or volume ?
No unfortunately. The original writers of the software didn't expose any means of controlling the speech engine. I presume such things are characteristic of each "voice", of which there is just one for this library.
Reply With Quote
  #4 (permalink)  
Old 12-01-2007, 02:52 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 422
Default

Hello agraham,

Thanks so much for this awesome wrapper!
Fortunately, the engine works for me in the application directory - what a relief

The voice sounds a bit scary, but can be adjusted within limits by playing with the text spelling.
Longer texts, say, in the order of 160 characters, cause a native exception error, though.

Last edited by alfcen : 12-01-2007 at 06:24 AM. Reason: Recommendation for readme file was unnecessary.
Reply With Quote
  #5 (permalink)  
Old 12-01-2007, 08:42 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,219
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by alfcen View Post
Longer texts, say, in the order of 160 characters, cause a native exception error, though.
The limit seems to be 127 characters, a value probably not without significance as it is the maximum value of an unsigned byte. I just missed picking this up as my largest test string was 123 characters long.

I didn't mention it but Say actually returns the number of characters spoken - a hangover from debugging the interface - so you can confirm this limit yourself if you wished.

Because of limitations in the Compact Framework I had trouble marshalling .NET wide strings into C type narrow strings across the DLL call and it is a bit ugly on the native side so I guess that it is related to this. I don't think there is any deeper problem, just an interface problem between the two different sorts of DLL.

I'll look at it to see if it is an easy fix - otherwise you will just have to keep the text shorter than this limit.
Reply With Quote
  #6 (permalink)  
Old 12-01-2007, 09:10 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 422
Default

No major problem, agraham, the text could be chunked for longer text conversions while the return value is of great help. Perhaps a 'shut up' (stop)command would be nice to have
Reply With Quote
  #7 (permalink)  
Old 12-01-2007, 10:05 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,219
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by alfcen View Post
Thanks so much for this awesome wrapper!
This was a huge amount of work - not just a wrapper. I had to port the original speech engine C code that was a Unix command line app. to the Visual Studio ARM native C++ compiler and then pack it into a native device DLL and then write the .NET wrapper! The wrapper was the easy bit - it took about 10 minutes - the big native DLL took more than a week of 8+ hour days including false starts!
Reply With Quote
  #8 (permalink)  
Old 12-01-2007, 10:12 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,219
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
I'll look at it to see if it is an easy fix
I have fixed it. My classic "C" is a bit rusty - the native ARM C++ compiler thinks that "chars" map to signed bytes - I was assuming unsigned Look out for a link to appear to "fliteDeviceUpdate1". Only the big native fliteDLL.dll is changed.

Quote:
Originally Posted by alfcen View Post
Perhaps a 'shut up' (stop)command would be nice to have
Sorry, it's not possible because it is running on the B4PPC thread so you don't get control back to stop it until it has stopped anyway!
Reply With Quote
  #9 (permalink)  
Old 12-01-2007, 10:44 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 422
Default

Please accept my sincere apologies, agraham. I did not mean to diminish your hard work. I am just not as deep into the matter as you are, thus ignorant about the kind and amount of work involved with DLLs and C programming. I hope you are in the mood for an apology.

Quote:
I have fixed it.
Sounds great! (I almost completed a chunk routine)

Thanks so much, I will look out for the update link.

I understand about the stop command and will work around it.

Cheers
Robert
Reply With Quote
  #10 (permalink)  
Old 12-01-2007, 10:48 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,219
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by alfcen View Post
I hope you are in the mood for an apology.
No need, I wan't upset at all. I just wanted you to know that behind the scenes some of this stuff can take a lot of time and effort (and background knowledge and sometimes luck) even if it is not obvious from the end result - a single call to a speech engine in this case
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Door library (Beta) - Special library Erel Official Updates 48 07-18-2008 02:33 PM
Merging Outlook library and Phone library Erel Official Updates 2 07-14-2008 03:38 PM
Using RAPI library to transfer database from device to desktop mozaharul Questions & Help Needed 4 04-01-2008 08:55 AM
Text To Speech library (desktop only) Louis Additional Libraries 6 11-16-2007 06:15 PM


All times are GMT. The time now is 05:51 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0