#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void showStyle(){
system("color f3");
system("title 发音小程序");
}
char userData[10000]="";
void inputUserData(){
memset(userData,0,10000);
printf("请输入文字:");
gets(userData);
}
int main(void){
while(1){
showStyle();
inputUserData();
//创建了一个FILE的指针 fp ,然后打开,名字+对文件需要进行的操作
FILE *fp=fopen("程序语言语音转文字测试.vbs","w");
fprintf(fp,"CreateObject(\"SAPI.SpVoice\").Speak(\"%s\")",userData);
fclose(fp);
system("voice.vbs");
}
system("pause");
return 0;
}
有意思的小技术(1) 文字转语音
最新推荐文章于 2024-03-28 22:17:06 发布