Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: Astral on June 28, 2009, 06:48:10 am

Title: Text-to-Speech
Post by: Astral on June 28, 2009, 06:48:10 am
I'm wondering if anyone has a simple text-to-speech unit I can
use to produce speech from my translator program.

I have SAPI5 and I have some simple code which works in Delphi, but it doesn't seem to compile on Lazarus/FPC.

I'd like to generate English speech output, but also would like to do other languages if possible.  I have some Microsoft voices working on my Delphi version of my program.

Title: Re: Text-to-Speech
Post by: Astral on June 30, 2009, 11:16:26 am
Surely Lazarus can tallk!   ;D

Has anyone tried to get this to work?  Or is the Delphi code for text-to-speech just totally incompatible with Lazarus/FPC?

Title: Re: Text-to-Speech
Post by: ivanmalone on July 08, 2009, 10:18:41 pm
are you running a linux environment? I've moved over from delphi to freepascal for some projects and I'm rewriting some components I used to use on windows.

The component is written in Delphi atm but I am porting them sometime over the next few days.

I want it to be cross platform between nix and windows, when on windows using the microsoft speach api and when on linux using festival.

I'm fairly new to Lazarus and Free-pascal development and miss some of the nifty tools I use day to day in the newest delphi. BUt I like the retro feel I get from using Lazarus. Most of these ports are my way of working through the kinks getting used to working with Lazarus.

Anyway, works kinda like this

Basic TTextToSpeak component derived from TComponent
Properties for manipulating characteristics of speach engine - pitch, speed etc)
Function to StartSpeaking
Function to StopSpeaking
SpeachEngine of types {seMicrosoftAPI, seFestivalAPI, seNone}

On windows the speach engine used is Microsofts dynamically linked in the component
On Linux it uses pipes to pipe the data to festival which then does the speach

There is probibly a better way to do it, but I've not looked into it much yet. Maybe GNOME (i'm using ubuntu atm) has a speach api, anyway. If you could tell me what kind of environment your working in or in which the component would need to work in my component might suit you. Its GPL'd of course.

Title: Re: Text-to-Speech
Post by: Astral on July 14, 2009, 12:16:20 am
Well, right now I'm running Lazarus/FPC on Windows XP.

I have some code in Delphi which uses the Microsoft SAPI (I think version 5.1) and
it works.  I didn't write it myself, just adapted it.

But I don't know how to adapt the Delpii components to Lazarus.

I would also like to have it work on Linux eventually.  I am running Ubuntu, but
not all the time, in a dual boot situation.
Title: Re: Text-to-Speech
Post by: Astral on July 14, 2009, 12:37:13 am
I read the Brian Long articles

I'm pretty sure that's how I got started.

But I don't know enough about components to adapt them to Lazarus.
TinyPortal © 2005-2018