SpVoice.GetVoices returned exception class EOleSysError

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SpVoice.GetVoices returned exception class EOleSysError

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.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SpVoice.GetVoices returned exception class EOleSysError

Michael Van Canneyt


On Sun, 9 Apr 2017, misabov wrote:

> 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SpVoice.GetVoices returned exception class EOleSysError

Free Pascal - General mailing list
In reply to this post by misabov
On 04/10/2017 02:58 AM, misabov wrote:

> 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;

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

SpeechLib_TLB.pas (432K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SpVoice.GetVoices returned exception class EOleSysError

Free Pascal - General mailing list
In reply to this post by misabov
On 04/10/2017 02:58 AM, misabov wrote:

> 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;
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SpVoice.GetVoices returned exception class EOleSysError

noreply
In reply to this post by misabov
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

On Mon, April 10, 2017 12:58 am, misabov wrote:

> 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 archive at Nabble.com.
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SpVoice.GetVoices returned exception class EOleSysError

fredvs
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 ;-)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SpVoice.GetVoices returned exception class EOleSysError

noreply
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..

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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SpVoice.GetVoices returned exception class EOleSysError

Lukasz Sokol
On 12/04/17 13:37, [hidden email] wrote:

> 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)

> 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.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SpVoice.GetVoices returned exception class EOleSysError

fredvs
In reply to this post by noreply
> 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 ;-)
Loading...