|
MS agent cambio de idioma
Hola,
Necesito de vuestra ayuda!.
Cómo puedo asignar al MS-AGENT Charlie que habla actualmente en español, la voz de Mary en Inglés?
Alguien tiene algún otro ejemplo de código para poder asignar correctamente el TTS y el idioma?...
Con el MS-Agent Properties viewer 3.1 obtengo las siguientes propiedades:
Character Details
------------------
Name: Charlie.
guid: {20E18DC3-EBE4-11D3-BE2A-C1646EB21146}
TTsModeID: {2CE326E0-A935-11D1-B17B-0020AFED142E}
LanguageID: 3082
Version: 2.00
Voice Detail
--------------
ModeName: Mary
ModeID:= {c77c5170-2867-11d0-847B-444553540000}
Speaker: Product Name: Default female voice
LanguageID: 1033
cuando se ejecuta el siguiente código da una excepción "access violation at ...."
{ set default language in English for listening}
myAgent.LanguageID:=1033; // ********** access violation ******
myAgent.SRModeID:=('{77C5170-2867-11D0-847B-444553540000}'); //se que no es el correcto...pero el error lo da en la asignación del idioma...
UTILIZO EL SIGUIENTE CODIGO extraido de un ejemplo
(DELPHI6, MS AGENT 2.0, SAPI 5.0)
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
OleCtrls, AgentObjects_TLB, StdCtrls, ExtCtrls, Buttons;
type
TForm1 = class(TForm)
SpeakEnglish: TSpeedButton;
Agent: TAgent;
procedure FormCreate(Sender: TObject);
procedure SpeakEnglishClick(Sender: TObject);
private
{ Private declarations }
myAgent: IAgentCtlCharacterEx;
myAgentRequests:IAgentCtlRequest;
bAgentListen,bAgentDialoog:Boolean;
sDefaultLanguage,sText:string;
procedure AgentLoad;
procedure AgentShow;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
sDefaultLanguage:='ENGLISH'; // or 'ENGLISH'
{ create agent}
AgentLoad;
AgentShow;
end;
procedure TForm1.AgentLoad;
var
myAgentID:string;
myAgentPath:string;
begin
{ load agent}
myAgentID:='Charlie';
myAgentPath:='c:\localizacion\Agents\'+myAgentID+'.acs';
Agent.Characters.Load(myAgentID,myAgentPath);
myAgent:=Agent.Characters.Item[myAgentID];
{ set default language in English for listening}
myAgent.LanguageID:=1033; //***************access violation***
myAgent.SRModeID:=('{77C5170-2867-11D0-847B-444553540000}'); //mary
{====== init charlie ============}
{ remove any existing commands}
myAgent.Commands.RemoveAll;
{ set menu caption}
myAgent.Commands.Caption:='Listen Charlie';
{ add commands }
myAgent.Commands.Add('charlie','Charlie is listening','Charlie*',True,True);
{ Show captions in pop-up menu }
myAgent.Commands.Visible:=True;
end;
procedure TForm1.AgentShow;
var p1:TPoint;
begin
with myAgent do begin
MoveTo(400,500,0);
show(0);
Speak('HELLO, I AM SPEAKING IN ENGLISH?','');
end;
end;
Gracias!.
Saludos!
Ernesto
|