ZD Screen Recorder SDK API – ScnLib_GetAudioSourceDevice()

ScnLib_GetAudioSourceDeviceA/W()

Std EditionPro EditionMax EditionUltra Edition
C++ __declspec(dllimport) BOOL __stdcall ScnLib_GetAudioSourceDeviceA(BOOL bPlayback, int nIndex, LPSTR pszDevice, LPSTR pszDeviceID);
__declspec(dllimport) BOOL __stdcall ScnLib_GetAudioSourceDeviceW(BOOL bPlayback, int nIndex, LPWSTR pwszDevice, LPWSTR pwszDeviceID);
C# [DllImport("ScnLib.dll", CharSet = CharSet.Unicode)] public static extern bool ScnLib_GetAudioSourceDeviceW(bool Playback, int Index, StringBuilder Device, StringBuilder DeviceID);
Basic Public Declare Unicode Function ScnLib_GetAudioSourceDeviceW Lib "ScnLib.dll" (ByVal Playback As Boolean, ByVal Index As Int32, ByVal Device As StringBuilder, ByVal DeviceID As StringBuilder) As Boolean
Delphi function ScnLib_GetAudioSourceDeviceA(Playback: LongBool; Index: Integer; Device: PAnsiChar; DeviceID: PAnsiChar): LongBool; stdcall; external 'ScnLib.dll';
function ScnLib_GetAudioSourceDeviceW(Playback: LongBool; Index: Integer; Device: PWideChar; DeviceID: PWideChar): LongBool; stdcall; external 'ScnLib.dll';
  • Description
    Obtain the name and ID of an audio source device based on its index.

  • 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.
    • Device [out]
      The string buffer allocated to receive the audio source device name. Ensure that the buffer has a capacity greater than 260 characters.
    • DeviceID [out]
      The string buffer allocated to receive the audio source device ID. Ensure that the buffer has a capacity greater than 260 characters.
  • Return Value
    If the name and ID of an audio source device are successfully obtained, the return value is TRUE. Otherwise, the return value is FALSE.

  • Remarks
    Use this function to obtain the name and ID of an audio source device based on its index. If the index is greater than or equal to 0 and less than the total device count, the Device and DeviceID parameters will be assigned the corresponding audio source device’s name and ID, and the function will return TRUE. If the index is less than 0, Device will receive the system’s default audio source device name, DeviceID will be set to an empty string, and the function will again return TRUE. If these conditions aren’t met, both Device and DeviceID will be set to empty strings and the function will return FALSE. To obtain the count of devices within a specific audio source category, call ScnLib_GetAudioSourceDeviceCount(). To review or configure the system’s audio source devices, call ScnLib_ConfigureAudioSourceDevices().

  • See Also
    ScnLib_GetAudioSourceDeviceCount()
    ScnLib_SelectAudioSourceDevice()
    ScnLib_GetSelectedAudioSourceDevice()
    ScnLib_ConfigureAudioSourceDevices()

Shopping Cart
  • Your cart is empty.
Scroll to Top