Why are you doing this:
if(strcmp(argv[1],"input.wav")!=0)
{
printf("Input is not a WAV file.\n");
return 0 ;
}
If you are going to use fixed filenames then there is no point in allowing the user to enter them at the console.
And later you have:
if(strcmp(argv[2],"output.wav")==0)
{
return 0 ;
}
So, if
argv[2]
is equal to
"output.wav"
, the program terminates immediately.
And even later you have:
input = fopen("argv[1]","r");
So you are trying to open a file named
"argv[1]"
, rather than the file whose name is stored in the variable
argv[1]
.
And the same issue at:
output =fopen("argv[2]","w");
All in all, quite a few basic errors to be corrected.