无法打开文件:./sysdeps/posix/system.c
Cannot open file: ../sysdeps/posix/system.c
我试图将一些字符串pat到 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 &");
。我该如何解决?
you think 有11个数组(句子),但实际上只有10个。这两个
"I am glad too meet you here "
"you can see many science and technology products here ",
实际上只是一个,因为您错过了最后的逗号
我确实将代码的这一部分运输到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;
unsigned int Size,position=0, end_position=0, flags=espeakCHARS_AUTO, *unique_identifier;
相关文章:
- POSIX open() 挂在 SMB 共享上
- C/C++:POSIX 兼容方式查找默认网络接口上/下
- 使用Boost async_read和POSIX::stream_descriptor从键盘读取
- 没有信号处理程序的POSIX定时器的目的是什么?
- 在目标计算机上访问 POSIX 信号灯时出现可执行文件崩溃(SEGV_MAPERR)
- 强大的 rwlock 在 posix
- 父进程和子进程之间的 POSIX 信号量
- POSIX C/C++日志文件(VEX V5 Brain)
- 适用于win32、linux、mac的POSIX C包装器
- POSIX 条件变量和互斥体"竞争"
- 如何在C++中挂起和恢复 POSIX 线程?
- 线程SCHED_RR Posix 计时器使用的是 100% CPU
- Posix 线程类和启动例程 (pthread)
- 从串行端口(POSIX)读取十六进制值
- 有没有一个 posix lstatat 调用这样的事情
- 为 posix recv 设置超时会导致 udp 数据包丢失吗?
- 用于 64 位/32 位 IPC 的 POSIX 信号量的替代方案?
- 当多个进程使用该段时,Posix 共享内存使用 mremap 调整大小
- POSIX(C )参数类型不匹配
- 无法打开文件:./sysdeps/posix/system.c