gpt4 book ai didi

c++ - 无法打开文件 : . ./sysdeps/posix/system.c

转载 作者:行者123 更新时间:2023-11-28 01:39:30 25 4
gpt4 key购买 nike

我正在尝试将一些字符串传递给 espeak,它会通过以下代码说出它们:

#include <string.h>
#include <malloc.h>
#include <espeak/speak_lib.h>
#include <iostream>

#include <stdlib.h>
#include <unistd.h>
//#include <cstring>
using namespace std;
int main()
{



espeak_POSITION_TYPE position_type;
espeak_AUDIO_OUTPUT output;
char *path=NULL;
int Buflength = 500, Options=0;
void* user_data;
t_espeak_callback *SynthCallback;
espeak_PARAMETER Parm;



char Voice[] = {"English"};

int i=0;

char text[11][200] {"hi ",
"This is...",
"you can ... ",
"I am ,,,, " ,
"you can ... ",
"hope you ... ",
"come in ... ",
"if you ... ",
"you will... ",
"I hope ... ",
"Take care "
};



unsigned int Size,position=0, end_position=0, flags=espeakCHARS_AUTO, *unique_identifier;


output = AUDIO_OUTPUT_PLAYBACK;

espeak_Initialize(output, Buflength, path, Options );
espeak_SetVoiceByName(Voice);
const char *langNativeString = "en_US";
espeak_VOICE voice= {0};

voice.languages = langNativeString;
voice.name = "US";
voice.variant = 2;
voice.gender = 1;
// Size = strlen(text)+1;


for (;;)
{



for(i=0; i<11; i++)
{
Size = sizeof(text[i]);
system("eog --fullscreen --disable-gallery --single-window 1.jpg &");
usleep(3000000);

espeak_Synth( text[i], Size, position, position_type, end_position, flags,
unique_identifier, user_data );
espeak_Synchronize( );
system("eog --fullscreen --disable-gallery --single-window 1.jpg &");
usleep(3000000);

}
//fflush(stdout);

}

return 0;
}

但是我得到了segmentation fault(core dumped)错误。我尝试调试代码,这是错误: Cannot open file: ../sysdeps/posix/system.c 出现在这行代码中:system("eog --fullscreen --disable-gallery --single-window 1.jpg &");.我该如何解决这个问题?

最佳答案

认为有 11 个数组(句子),但实际上只有 10 个。这两个

          "I am glad too meet you here "
"you can see many science and technology products here ",

实际上只有一个,因为你错过了末尾的逗号

关于c++ - 无法打开文件 : . ./sysdeps/posix/system.c,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47834342/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com