⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 disp2.cpp

📁 声音采集源程序
💻 CPP
字号:
#include "stdio.h"
#include "graphics.h"
#include "math.h"
#define  PI  3.14159
#define  SIZE 2
#define   N  2048
#define   K  1
#define  NULL 0
void display(sx,xy)
 int sx[N/K],xy;
{ int i;
  setbkcolor(WHITE);
  setcolor(RED);
  moveto(0,getmaxy()/2+xy);
  lineto(600,getmaxy()/2+xy);
  moveto(10,getmaxy()/2+xy);
  lineto(10,getmaxy()/2-200+xy);
  moveto(10,getmaxy()/2+xy);
  lineto(10,getmaxy()/2+200+xy);
  setcolor(BLUE);
  for(i=1;i<600;i++)
    { sx[i]=sx[i]/500;
      moveto(i+9,getmaxy()/2-sx[i-1]+xy);
      lineto(i+10,getmaxy()/2-sx[i]+xy);
     }
  }
main()
{ int s1[N],s2[N],ss1[N/K];
  FILE *fp;
  int i,j,sa,a,m,n;
  float aver;
  int gdriver=DETECT,gmode;
  initgraph(&gdriver,&gmode,"c:\\bc31\\bgi");
  gmode=getgraphmode();
  restorecrtmode();

  if((fp=fopen("smad.bin","rb"))==NULL)
	{printf("can not open file");
	 }
  for(i=0;i<N/2;i++)
	 {if(fread(&s1[i],SIZE,1,fp)!=1)
	  printf("file read error\n");
	  if(fread(&s2[i],SIZE,1,fp)!=1)
	  printf("file read error\n");
	 }
  fclose(fp);
  setgraphmode(gmode);
  display(s1,-60);
  display(s2,120);
  getchar();
  restorecrtmode();
  closegraph();
  }


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -