Function to update the previous audio input device.
Param: options.parameters.switchUserAudio
Function to switch the user's audio.
Returns
A promise that resolves when the audio input has been switched.
Remarks
This function checks if the user's preferred audio device differs from the current default.
If so, it updates the previous audio device and the current default audio device.
It then calls the function to switch the user's audio.
Switches the audio input device based on user preference.
Param: options
The options for switching the audio input.
Param: options.audioPreference
The ID of the preferred audio input device.
Param: options.parameters
The parameters required for switching the audio.
Param: options.parameters.defAudioID
The default audio input device ID.
Param: options.parameters.userDefaultAudioInputDevice
The current default audio input device ID.
Param: options.parameters.prevAudioInputDevice
The previously used audio input device ID.
Param: options.parameters.updateUserDefaultAudioInputDevice
Function to update the user's default audio input device.
Param: options.parameters.updatePrevAudioInputDevice
Function to update the previous audio input device.
Param: options.parameters.switchUserAudio
Function to switch the user's audio.
Returns
A promise that resolves when the audio input has been switched.
Remarks
This function checks if the user's preferred audio device differs from the current default. If so, it updates the previous audio device and the current default audio device. It then calls the function to switch the user's audio.
Example