Recent

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

misabov

  • Newbie
  • Posts: 3
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

  • Hero Member
  • *****
  • Posts: 2223
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: 3
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

 

TinyPortal © 2005-2018