0

这用于在 Windows 10 上工作,但现在不能,而且我找不到如何更正代码以使其工作。

void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
  ISpeechObjectTokenPtr token;
  ISpeechObjectTokensPtr tokens;
  tokens=SpVoice1->GetVoices(L"",L"");
  token=tokens->Item(ComboBox1->ItemIndex);
  SpVoice1->Voice=token;
}

还有错误(无法访问):

SpVoice1->Volume
SpVoice->Rate

如果我注释掉Voice,RateVolume, 它将编译并运行良好。

Windows 10 64 位内部版本 19041.867

4

1 回答 1

0

只需要进行一些更改。

- SpVoice1->Volume=Vol->Position; //(Vol is the name of my trackbar)
+ SpPVoice1->set_Volume(Vol->Position);

- SpVoice1->Rate=Rate->Position;  //(Rate is the name of my trackbar)
+ SpVoice1->set_Rate(Rate->Position);

- SpVoice1->Voice=token;
+ SpVoice1->_set_Voice(token);
于 2021-03-25T20:52:19.677 回答