как получить объем микшера - PullRequest
0 голосов
/ 25 мая 2011

Я написал приложение, использующее функцию win32api для получения и установки громкости микшера. Я столкнулся с проблемой, чтобы получить объем микшера для моего приложения (получить значение). GetVolume -

public static int GetVolume()  
{  //method level variables  
    int currVolume;  
    int mixerControl;  
    //create a new volume control  
    VolumeStructs.Mixer mixer = new VolumeStructs.Mixer();  
    //open the mixer  
   PCWin32.mixerOpen(out mixerControl, 0, 0, 0, 0);  
    //set the type to volume control type  
    int type = VolumeConstants.MIXERCONTROL_CONTROLTYPE_VOLUME;  
    //get the mixer control and get the current volume level  
     GetMixer(mixerControl, VolumeConstants.MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, type, out mixer, out currVolume);  
   //close the mixer control since we are now done with it  
    PCWin32.mixerClose(mixerControl);  
    //return the current volume to the calling method  
   return currVolume;  
 } 
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...