赞
踩
- static int save_audio(int seq, char *audio_buff, int len)
- {
- char file_name[64] = {0};
- int ret = 0;
- snprintf(file_name, sizeof(file_name), "/tmp/audio_file_%d", seq);
-
- FILE *fp = fopen(file_name, "w+");
- if (!fp) {
- return -1;
- }
-
- ret = fwrite((void*)audio_buff, sizeof(char), len, fp);
- if(ret != len) {
- printf("write audio_buff len=%d,ret=%d failed\n",len,ret);
- fclose(fp);
- return -1;
- }
-
- fclose(fp);
- return 0;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。