ScnLib_SelectAudioSourceDevice()

ScnLib_SelectAudioSourceDevice()

Std EditionPro EditionMax EditionUltra Edition
C++ __declspec(dllimport) BOOL __stdcall ScnLib_SelectAudioSourceDevice(BOOL bPlayback, int nIndex);
C# [DllImport("ScnLib.dll")] public static extern bool ScnLib_SelectAudioSourceDevice(bool Playback, int Index);
Basic Public Declare Function ScnLib_SelectAudioSourceDevice Lib "ScnLib.dll" (ByVal Playback As Boolean, ByVal Index As Int32) As Boolean
Delphi function ScnLib_SelectAudioSourceDevice(Playback: LongBool; Index: Integer): LongBool; stdcall; external 'ScnLib.dll';
  • Description
    Choose an audio source device by index, setting it as the active audio recording source for the specified category.

  • Parameters
    • Playback [in]
      TRUE: Within the playback audio source category, which typically includes audio output devices like speakers and headphones.
      FALSE: Within the recording audio source category, which typically includes audio input devices like microphones and line-ins.
    • Index [in]
      The specified index for the audio source device, ranging from 0 to the device count - 1.
  • Return Value
    If an audio source device is selected successfully, the return value is TRUE. Otherwise, the return value is FALSE.

  • Remarks
    Use this function to choose an audio source device by index, setting it as the active audio recording source for the specified category. If the index is greater than or equal to 0 and less than the device count, the respective audio source device is selected. If the index is less than 0, the system's default audio source device is chosen. If these conditions are not met, no device will be active for audio recording in the specified category.

    By default, only the system's default audio playback device is active. You are permitted to change the active audio source device even during the recording process. To check the index of the currently selected device in the specified audio source category, call ScnLib_GetSelectedAudioSourceDevice(). To adjust the system's default audio source devices, call ScnLib_ConfigureAudioSourceDevices().

  • See Also
    ScnLib_GetAudioSourceDeviceCount()
    ScnLib_GetAudioSourceDeviceA/W()
    ScnLib_GetSelectedAudioSourceDevice()
    ScnLib_ConfigureAudioSourceDevices()

Try the SDK for FREE SDK APIs overview