please help I want to reading .wav file and putting ito inot the array to do some manipulations.... here is the bit of the code, I am trying to read the file called yes1.wav and putting it into the array and it returining junk...sometime cannot open the fp1 = fopen( argv[1], "rb" ) or cannot open it at all
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int *speechyes;
void main(char argc, char *argv[] )
{
FILE *fp1,*fp3;
//if ( argc != 3 )
//{
// printf("differ fileone filetwo\n");
// exit(0);
//}
fp3 = fopen("yes1.wav","w");
//fp1 = fopen( argv[1], "rb" );
if(!fp1 )
{
printf("Error opening file %s \n");
}
int k=0;
speechyes = new int[50000];
while(fread(&speechyes[k],2,1,fp3)==2)
{
k++;
}
cout<<k<<endl;
for(int i=0;i<5;i++)
{
cout<<speechyes[i]<<endl;
}
}