/
UpdateAudioInput (Unity)
UpdateAudioInput (Unity)
- Declaration
public static void UpdateAudioInput(CavrnusInputDevice device)
- Description
Sets which microphone the user wishes to use. Note that the CavrnusInputDevice
provided to this function can only be acquired by calling FetchAudioInputs to search for available microphones.
- Sample
public class AudioInputSelector : MonoBehaviour
{
private List<CavrnusInputDevice> audioDevices;
private int currentDeviceIndex = 0;
private void Start()
{
CavrnusFunctionLibrary.AwaitAnySpaceConnection(spaceConn => {
CavrnusFunctionLibrary.FetchAudioInputs(devices => {
audioDevices = devices;
});
});
}
public void SelectNextDevice()
{
currentDeviceIndex = (currentDeviceIndex + 1) % audioDevices.Count;
CavrnusFunctionLibrary.UpdateAudioInput(audioDevices[currentDeviceIndex]);
}
public void SelectPreviousDevice()
{
currentDeviceIndex = (currentDeviceIndex - 1 + audioDevices.Count) % audioDevices.Count;
CavrnusFunctionLibrary.UpdateAudioInput(audioDevices[currentDeviceIndex]);
}
}
, multiple selections available,
Related content
FetchAudioInputs (Unity)
FetchAudioInputs (Unity)
More like this
FetchVideoInputs (Unity)
FetchVideoInputs (Unity)
Read with this
UpdateAudioInput (Unreal Engine)
UpdateAudioInput (Unreal Engine)
More like this
SetLocalUserMutedState (Unity)
SetLocalUserMutedState (Unity)
Read with this
FetchAudioInputs (Unreal Engine)
FetchAudioInputs (Unreal Engine)
More like this
BindSpaceUsers (Unity)
BindSpaceUsers (Unity)
Read with this