I am new to alsa and trying to implement audio recording from mic. I want to implement mute function and wrote below api. I am not sure if using snd_pcm_pause for mute is the correct way to implement mute. I am able to stop audio recording but when trying to resume audio is not recorded.
Here is how sample code for that.
int rc;
rc = snd_pcm_pause(pcm_handle, flag);
if(rc < 0 && flag==0){
printf("mic resume failed");
return false;
}else if(rc < 0 && flag==1){
fprintf("mic pause failed");
return false;
}
return true;