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]);
}
}
Related content
FetchAudioInputs (Unity)
FetchAudioInputs (Unity)
More like this
UpdateAudioInput (Unreal Engine)
UpdateAudioInput (Unreal Engine)
More like this
UpdateAudioOutput (Unreal Engine)
UpdateAudioOutput (Unreal Engine)
More like this
UpdateVideoInput (Unity)
UpdateVideoInput (Unity)
More like this
FetchAudioInputs (Unreal Engine)
FetchAudioInputs (Unreal Engine)
More like this
FetchAudioOutputs (Unreal Engine)
FetchAudioOutputs (Unreal Engine)
More like this