Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-04

SpVoice.GetVoices returned exception class EOleSysError

9 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

misabov

The project has generated an exception class EOleSysError with a message: ???? ?????? ?? ??????.

uses
...,ComObj;
var
SpVoice: Variant;
SpVoice := CreateOleObject('SAPI.SpVoice');
SpVoice.Voice:= SpVoice.GetVoices('','').Item(0);

SpVoice GetVoices method (SAPI 5.3) cannot return a selection of voices available to the voice.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/SpVoice-GetVoices-returned-exception-class-EOleSysError-tp5728192.html Sent from the Free Pascal - General mailing list .
Michael Van Canneyt
to misabov
misabov wrote 14 lines
The project has generated an exception class EOleSysError with a message: ???? ?????? ?? ??????. uses ...,ComObj; var SpVoice: Variant; SpVoice := CreateOleObject('SAPI.SpVoice'); SpVoice.Voice:= SpVoice.GetVoices('','').Item(0); SpVoice GetVoices method (SAPI 5.3) cannot return a selection of voices available to the voice.

That sounds like a problem of your OLE server, not of Pascal ?

Michael.

Andrew Haines
to misabov: The project has generated an exception class EOleSysError with a message: ???? ?????? ??…
misabov wrote 17 lines
The project has generated an exception class EOleSysError with a message: ???? ?????? ?? ??????. uses ...,ComObj; var SpVoice: Variant; SpVoice := CreateOleObject('SAPI.SpVoice'); SpVoice.Voice:= SpVoice.GetVoices('','').Item(0); SpVoice GetVoices method (SAPI 5.3) cannot return a selection of voices available to the voice.

A long time ago I played with MS sapi. I will try to put the relevant code here for you. My goal was to put the output speech into memory to be processed further. I attached the generated speechlib_tlb unit. I think I used the fpc tool importtl to generate this unit. But its been a long time. The file is dated 2002.

Regards,

Andrew Haines

uses
OleServer, ComObj, Speechlib_tlb, Windows, Variants, ActiveX, ...

var
   SpeechVoice: ISpeechVoice;
   Voice: TSpVoice;
   Voices: ISpeechObjectTokens;
   ToSpeak: OleVariant;
   i: Integer;
   VoiceList: TStringList;
begin
   CoInitialize(nil);
   Voice := TSpVoice.Create(self);
   CoCreateInstance(CLASS_SpVoice, nil, CLSCTX_ALL, IID_ISpeechVoice,
SpeechVoice);
   Voice.ConnectTo(SpeechVoice);
   Voices := Voice.GetVoices('','');
   VoiceList := TStringList.Create;
   for i := 0 to Voices.Get_Count -1 do
     VoiceList.AddObject(Voices.Item(I).GetDescription(0),
TObject(Voices.Item(I)));
   Voice.Voice := ISpeechObjectToken(Pointer(VoiceList.Objects[0])); //
0 is the index of the desired voice.
   // VoiceList.Strings[x] is a text description of the voice
   ToSpeak := 'Hello MS SAPI';
   Voice.speak(ToSpeak, SVSFDefault);
   // cleanup
end;
Andrew Haines
to misabov: The project has generated an exception class EOleSysError with a message: ???? ?????? ??…
misabov wrote 16 lines
The project has generated an exception class EOleSysError with a message: ???? ?????? ?? ??????. uses ...,ComObj; var SpVoice: Variant; SpVoice := CreateOleObject('SAPI.SpVoice'); SpVoice.Voice:= SpVoice.GetVoices('','').Item(0); SpVoice GetVoices method (SAPI 5.3) cannot return a selection of voices available to the voice.

A long time ago I played with MS sapi. I will try to put the relevant code here for you. My goal was to put the output speech into memory to be processed further. I think I used the fpc tool importtl to generate the Speechlib_tlb unit. But its been a long time now. I can email you directly the file if you want.

Regards,

Andrew Haines

uses
OleServer, ComObj, Speechlib_tlb, Windows, Variants, ActiveX, ...

var
   SpeechVoice: ISpeechVoice;
   Voice: TSpVoice;
   Voices: ISpeechObjectTokens;
   ToSpeak: OleVariant;
   i: Integer;
   VoiceList: TStringList;
begin
   CoInitialize(nil);
   Voice := TSpVoice.Create(self);
   CoCreateInstance(CLASS_SpVoice, nil, CLSCTX_ALL, IID_ISpeechVoice,
SpeechVoice);
   Voice.ConnectTo(SpeechVoice);
   Voices := Voice.GetVoices('','');
   VoiceList := TStringList.Create;
   for i := 0 to Voices.Get_Count -1 do
     VoiceList.AddObject(Voices.Item(I).GetDescription(0),
TObject(Voices.Item(I)));
   Voice.Voice := ISpeechObjectToken(Pointer(VoiceList.Objects[0])); //
0 is the index of the desired voice.
   // VoiceList.Strings[x] is a text description of the voice
   ToSpeak := 'Hello MS SAPI';
   Voice.speak(ToSpeak, SVSFDefault);
   // cleanup
end;
Lars
to misabov: The project has generated an exception class EOleSysError with a message: ???? ?????? ??…

Do you know about fpu issue, described on wiki?
http://wiki.freepascal.org/SAPI
Is it an fpu exception or something else?

And stackoverflow
http://stackoverflow.com/questions/3032739/delphi-sapi-text-to-speech

Regards
Toppost

misabov wrote 30 lines
The project has generated an exception class EOleSysError with a message: ???? ?????? ?? ??????. uses ...,ComObj; var SpVoice: Variant; SpVoice := CreateOleObject('SAPI.SpVoice'); SpVoice.Voice:= SpVoice.GetVoices('','').Item(0); SpVoice GetVoices method (SAPI 5.3) cannot return a selection of voices available to the voice. -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/SpVoice-GetVoices-return ed-exception-class-EOleSysError-tp5728192.html Sent from the Free Pascal - General mailing list . _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
fredvs
to Lars

Hello.

There is also a free-open-source project : espeak : http://espeak.sourceforge.net

The licence is GNU General Public License so you may use the executable like you want.

If you want to use the espeak library only, there is a fpc header here:

https://github.com/fredvs/sak/blob/master/sak_dll/sak_dll_fpg/src/uos_espeak.pas

But in this case, the license differs.

Fre;D

-----
Many thanks ;-)

Unknown author
to fredvs
fredvs wrote 8 lines
Hello. There is also a free-open-source project : espeak : http://espeak.sourceforge.net The licence is GNU General Public License so you may use the executable like you want.

The GPL is a restrictive license, so you may not use it like you want..

LGPL would be more close to "like you want" but not really ;-)

As you know, mit/bsd is really "like you want" license ;-)

So espeak really is a gpl 2/3 and not LGPL?
They are limiting their audience a lot...

I suppose if you just call the Exe and do piping this is not a violation of the GPL according to Richard Stallman... even though, technically any pipe is really using GPL code inside your exe just in a sort of unscrupulous way to get around the restrictive license. IMO loading a dll or piping in an exe is basically the same thing, but GPL lawyers would likely say piping is okay but loading a dll is not.

Would still prefer if espeak was LGPL so there is no concern. Or, modified lgpl/mit/bsd. But whatever

Lukasz Sokol
to Unknown author
Show quoted text 12 lines
On 2017-04-12 07:01, fredvs wrote: > Hello. > > There is also a free-open-source project : espeak : > http://espeak.sourceforge.net > > The licence is GNU General Public License so you may use the > executable like you want. The GPL is a restrictive license, so you may not use it like you want..

Don't want to sound like a GPL zealot, b/c I'm not...

but this (and below) is mostly 'depends' : on how you want the software model to work, how do you value feedback, and how do you care of people taking advantage of your code in various ways, without you knowing it.

There, that's about as neutral as I dare to name it ;)

(I also tend to trust GPL/LGPL/MPL released programs more than I'd do with anything 'less restrictive' - from end user perspective)

Show quoted text 7 lines
LGPL would be more close to "like you want" but not really ;-) As you know, mit/bsd is really "like you want" license ;-) So espeak really is a gpl 2/3 and not LGPL? They are limiting their audience a lot...

-L.

fredvs
to Unknown author: The GPL is a restrictive license, so you may not use it like you want.. LGPL would be…
I suppose if you just call the Exe and do piping this is not a violation of

the GPL according to Richard Stallman

Yes, it is what answered the author when I asked it by email. About using the library directly (with loadlib(espeak.so) or statically) he answered that ... the license is clear, you have then to give your code...

Would still prefer if espeak was LGPL so there is no concern.

Huh, I ask him if he had plan to re-licence into LGPL but, no answers yet...

By the way I have tested intensively the 2 options:
1) Use of espeak executable + parameters with a TProcess
2) Use espeak library via loadlib.

Sincerely both work perfectly, no one is faster than the other. And the few more exported methods does not give lot of plus vs the executable + parameters.

Fre;D
.

-----
Many thanks ;-)