* * *

Author Topic: SpVoice.GetVoices returned exception class EOleSysError  (Read 948 times)

misabov

  • Newbie
  • Posts: 2
SpVoice.GetVoices returned exception class EOleSysError
« on: April 10, 2017, 12:57:11 pm »
Hi!
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.

ASerge

  • Sr. Member
  • ****
  • Posts: 431
Re: SpVoice.GetVoices returned exception class EOleSysError
« Reply #1 on: April 12, 2017, 10:01:31 pm »
Cast to IDispatch:
Code: Pascal  [Select]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. var
  3.   SpVoice, Voices, Voice: OleVariant;
  4. begin
  5.   SpVoice := CreateOleObject('SAPI.SPVoice');
  6.   Voices := SpVoice.GetVoices;
  7.   Voice := Voices.Item(0);
  8.   Caption := string(Voice.GetDescription);
  9.   SpVoice.Voice := IDispatch(Voice); // := Voice not work
  10. end;

misabov

  • Newbie
  • Posts: 2
Re: SpVoice.GetVoices returned exception class EOleSysError
« Reply #2 on: April 17, 2017, 02:05:57 am »
 :) ASerge Thank you very much. That's what I was looking for

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus