Subject: [linux-audio-dev] Mute Microphone via Linux System Call
From: Anes Lihovac (al_AT_axxteq.de)
Date: Wed Jan 05 2000 - 12:16:02 EET
Hello !
How can I mute the microphone or volume off the mixer:
I am doing this:
Pseudo Code (more or less) !!!
int mixer; //my file descriptor
mixer=open("/dev/mixer",O_RDRW);
int vol;
if(mixer)
{
1)
int rc;
rc=ioctl(mixer,MIXER_WRITE(SOUND_MIXER_MIC),&vol);
printf("Microphone setting(ZERO is okay) : %d\n" ,rc);
2)
rc=ioctl(mixer,MIXER_WRITE(SOUND_MIXER_MIC|SOUND_MIXER_MUTE),&vol);
printf("Microphone setting MUTE(ZERO is okay):%d\n",rc)
//This allways fails(-1), I think the call isn' t right
3)
vol=0;
rc=ioctl(mixer,MIXER_WRITE(SOUND_MIXER_VOLUME),&vol);
printf("Volume setting (ZERO IS OKAY): %d\n",rc);
close(mixer);
}
else
{
//Errorhandling
}
Point 1 and 3 are always okay. but the second one alway fails. I think
the call system call isn't right. If anyone knows how to do it right,
please drop a line.
Thanks in advance and best regards
Anes Lihovac
This archive was generated by hypermail 2b28 : Sat Apr 07 2001 - 15:25:41 EEST