[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-audio-dev
Subject:    [linux-audio-dev] Mute Microphone via Linux System Call
From:       Anes Lihovac <al () axxteq ! de>
Date:       2000-01-05 10:16:02
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic