all. 어떤 도움을 주셔서 감사합니다. 텍스트 - 투 -의 플립을 사용하여, 나는 텍스트 파일은 파일에 텍스트 음성 변환을 수행 걸릴 것 "Windows Form에 VC++"에서 일부 코드를 작성했습니다 : 여기 함수가 호출되기 전에 모든 코드가 실행되지 않습니다.
내 문제입니다 음성 알고리즘. 텍스트가 MS "말하기"기능을 사용하여 발성 된 후 텍스트 상자에 몇 가지 헤더 정보와 내용을 기록해야합니다. 그 후 count 변수가 업데이트되고 다른 방향에서 다른 음성을 합성하는 다른 함수가 호출됩니다.
문제는 머리글 정보와 음성 단어가 textBox에 쓰여지기 전에 두 번째 기능이 호출되고 일단 끝나면 그 정보로 textBox를 채우는 것입니다. 만. 첫 번째 정보는 textBox에 기록되지 않습니다.
무엇이 원인 일 수 있습니까 ?? 두 번째 함수에 대한 호출을 여러 가지 다른 방법으로 지연 시키려고했지만 성공하지 못했습니다. 나는 밖에서 많은 도움을 얻을 수있을 것입니다. 이 두 가지 코드 단편을이 질문에 사용합니다. 미리 감사 드리며 정말로 도움이되기를 바랍니다. 다시 한번 감사드립니다. 두 번째 호출로
첫 번째 코드 :
for(ClickCount_ATCText = 0; ClickCount_ATCText < FilesSelected_ATC_A; ClickCount_ATCText++)
{
SetChannelVolumeLevel(ATC_OverLord);
PlaySound(TEXT("c:\\SSL_Sound\\AC_AudioBackground.wav"), NULL, SND_FILENAME);
//GetWavFilePath(ATC_OverLord);
//if(ClickCount_ATCText > (FilesSelected_ATC_A - 1))
//{
//ClickCount_ATCText = 0;
//}// End DataLink if statement
SpeechSynthesizer^ Vocalize = gcnew SpeechSynthesizer(); //Create a voice synthesizer instance.
string TTS_TxtPath = ATC_TxtFiles[ClickCount_ATCText]; //The following two lines converts the standard string in to a system string for use in the StreamReader function.
String^ TTS_FilePath = gcnew String(TTS_TxtPath.c_str());
StreamReader^ FileRead = gcnew StreamReader(TTS_FilePath); //Get the text file from the path identified.
String^ AutoTTSFileRead = FileRead->ReadToEnd(); //Read the entire file and store the text characters in the string variable "AutoTTSFileRead".
Vocalize->Speak(AutoTTSFileRead); //Vocalize the text in the textbox.
//Sleep(3000); //Pause half a second before displaying the text. Not needed, but kept for reference.
//* The 6 lines code below provides a timestamp and formats the output of the data link message.
TextToSpeechTextbox->Text = " Data Link Message \r\n \r\n";
time(&WhatTimeIsIt);
String^ strNew = gcnew String(ctime(&WhatTimeIsIt));
TextToSpeechTextbox->Text = TextToSpeechTextbox->Text + "Timestamp: " + strNew + "\r\n";
TextToSpeechTextbox->Text = TextToSpeechTextbox->Text + "\r\n";
TextToSpeechTextbox->Text = TextToSpeechTextbox->Text + "Message: " + AutoTTSFileRead + "\r\n"; //Display the speech data in the text box.
ClickCount_ATCText++;
NE_STT_SLL_Function();
}//End for loop
**NE_STT_SLL_Function:**
void NE_STT_SLL_Function()
{
//Sleep(3000);
SetChannelVolumeLevel(North_East); //Set the volume level for this SSL and zero the rest.
PlaySound(TEXT("c:\\SSL_Sound\\AC_AudioBackground.wav"), NULL, SND_FILENAME); //Play a snippet of radio noise in the background before sythesizing
if(ClickCount_NorthEastText >= (FilesSelected_NE - 1))
{
ClickCount_NorthEastText = 0;
}// End DataLink if statement
SpeechSynthesizer^ Vocalize = gcnew SpeechSynthesizer(); //Create a voice synthesizer instance.
string TTS_TxtPath = NorthEast_TxtFiles[ClickCount_NorthEastText]; //The following two lines converts the standard string in to a system string for use in the StreamReader function.
String^ TTS_FilePath = gcnew String(TTS_TxtPath.c_str());
StreamReader^ FileRead = gcnew StreamReader(TTS_FilePath); //Get the text file from the path identified.
String^ AutoTTSFileRead = FileRead->ReadToEnd(); //Read the entire file and store the text characters in the string variable "AutoTTSFileRead".
Vocalize->Speak(AutoTTSFileRead); //Vocalize the text in the textbox.
//* The 6 lines code below provides a timestamp and formats the output of the data link message.
TextToSpeechTextbox->Text = " (NE) Sound Source Location Message \r\n \r\n";
time(&WhatTimeIsIt);
String^ strNew = gcnew String(ctime(&WhatTimeIsIt));
TextToSpeechTextbox->Text = TextToSpeechTextbox->Text + "Timestamp: " + strNew + "\r\n";
TextToSpeechTextbox->Text = TextToSpeechTextbox->Text + "\r\n";
TextToSpeechTextbox->Text = TextToSpeechTextbox->Text + "Message: " + AutoTTSFileRead + "\r\n"; //Display the speech data in the text box.
ClickCount_NorthEastText++; //Increment array index value.
return;
}//End NE STT SSL function