Mountain View
Jabber SDK API Documentation

Tutorial: Select And Use Microphone

Select And Use Microphone

Title Microphone device is input audio device on local machine. As it is shown in Retrieving And Using Media Device Lists tutorial, Microphone device can be acquired from MultimediaController.microphoneList property. Acquired Microphone device can then be set as an active microphone device through MultimediaController.selectMicrophone method, as it is shown in the snippet below:

        // In this example it is assumed, that used index is valid
        var microphone = cwic.MultimediaController.microphoneList[0];

        cwic.MultimediaController.selectMicrophone(microphone);
    
Setting new microphone device as active will trigger "onMediaDeviceListChanged" event.

Volume Control (Windows OS Only)

Volume control is supported only on Windows OS. Microphone's input volume level can be set through Microphone.setVolume method. Current input volume level can be read from Microphone.volume property. In the snippet it is demonstrated how to retrieve and set microphone's input volume level:

        // In this example it is assumed, that used index is valid
        var microphone = cwic.MultimediaController.microphoneList[0];

        // Current microphone's input volume level.
        var currentVolume =  microphone.volume;

        // Setting new microphone's input volume level to 50 (0-100 accepted values)
        microphone.setVolume(50);
    

Next

Previous