How can I capture an audio input of a WAV file through microphone in c for windows 8 ? I have searched for,but i couldn't find one the way i looked for. I do not want to use any additional software tool and I want it in C programming language. My friends advised to me to use a different language like java or change the IDE. i want to be sure first that it is not done in C, using Dev-C++ and with out any additional tool. Now am wondering if this is available at all because i couldn't find such C-functions to capture audio from live input. am using Dev-C++ IDE. I can read and process if it is from stored file in HDD. I appreciate any hint
for files already stored in a disc, i have the following snippet:
if ((wptr1 = fopen(wavContent1, "rb")) == NULL)
{
printf("Cannot open the input file\n");
ret = FAIL;
}
else if ( (wptr2 = fopen((wavContentout), "wb")) == NULL )
{
printf("Cannot open the output file\n");
ret = FAIL;
}
else {
hdInfo=malloc(sizeof(header)) ;
writeReadable(wptr1,wptr2);
fclose(wptr2);
fclose(wptr1);
}
and for the function writeReadable() i have the following shortened code:
void writeReadable(FILE *wavin, FILE *wavout){
int BUFSIZE=128;
int buff[BUFSIZE];
int* buf=buff;
fread(hdInfo, sizeof(header), 1, wavin);
fwrite(hdInfo, sizeof(*hdInfo), 1, wavout);
while (!feof(wavin))
{
fread(buff, BUFSIZE, 1, wavin);
fwrite(buff, BUFSIZE, 1, wavout);
size= size + BUFSIZE;
count++;
}
size=size + sizeof(*hdInfo);
}