wasapisrc

wasapisrc

Properties

GstWasapiDeviceRole role Read / Write
gchar * device Read / Write
gboolean exclusive Read / Write
gboolean low-latency Read / Write
gboolean use-audioclient3 Read / Write

Types and Values

struct GstWasapiSrc

Description

Provides audio capture from the Windows Audio Session API available with Vista and newer.

Example pipelines

1
gst-launch-1.0 -v wasapisrc ! fakesink

Capture from the default audio device and render to fakesink.

1
gst-launch-1.0 -v wasapisrc low-latency=true ! fakesink

Capture from the default audio device with the minimum possible latency and render to fakesink.

Synopsis

Element Information

plugin

wasapi

author

Nirbheek Chauhan <nirbheek@centricular.com>

class

Source/Audio

Element Pads

name

src

direction

source

presence

always

details

audio/x-raw, format=(string)F32LE, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]

Functions

Types and Values

struct GstWasapiSrc

struct GstWasapiSrc {
  GstAudioSrc parent;

  IMMDevice *device;
  IAudioClient *client;
  IAudioClock *client_clock;
  guint64 client_clock_freq;
  IAudioCaptureClient *capture_client;
  HANDLE event_handle;
  HANDLE thread_priority_handle;
  /* Client was reset, so it needs to be started again */
  gboolean client_needs_restart;

  /* Actual size of the allocated buffer */
  guint buffer_frame_count;
  /* The mix format that wasapi prefers in shared mode */
  WAVEFORMATEX *mix_format;
  /* The probed caps that we can accept */
  GstCaps *cached_caps;
  /* The channel positions in the data read from the device
   * we will pass this to GstAudioRingbuffer so it can
   * translate it to the native GStreamer channel layout. */
  GstAudioChannelPosition *positions;

  /* properties */
  gint role;
  gint sharemode;
  gboolean low_latency;
  gboolean try_audioclient3;
  wchar_t *device_strid;
};

Property Details

The “role” property

  “role”                     GstWasapiDeviceRole

Role of the device: communications, multimedia, etc

Flags: Read / Write

Default value: console


The “device” property

  “device”                   gchar *

WASAPI playback device as a GUID string

Flags: Read / Write


The “exclusive” property

  “exclusive”                gboolean

Open the device in exclusive mode

Flags: Read / Write

Default value: FALSE


The “low-latency” property

  “low-latency”              gboolean

Optimize all settings for lowest latency. Always safe to enable.

Flags: Read / Write

Default value: FALSE


The “use-audioclient3” property

  “use-audioclient3”         gboolean

Whether to use the Windows 10 AudioClient3 API when available

Flags: Read / Write

Default value: FALSE