wasapisink: GStreamer Bad Plugins 1.0 Plugins Reference Manual

## wasapisink wasapisink |

## Properties

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

## Types and Values

struct | GstWasapiSink

## Description

Provides audio playback using the Windows Audio Session API available with Vista and newer.

#### Example pipelines

    1
    gst-launch-1.0 -v audiotestsrc samplesperbuffer=160 ! wasapisink

Generate 20 ms buffers and render to the default audio device.

    1
    gst-launch-1.0 -v audiotestsrc samplesperbuffer=160 ! wasapisink low-latency=true

Same as above, but with the minimum possible latency

## Synopsis

### Element Information

plugin | wasapi
author | Nirbheek Chauhan <nirbheek@centricular.com>
class | Sink/Audio

### Element Pads

name | sink
direction | sink
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 GstWasapiSink

    struct GstWasapiSink {
      GstAudioSink parent;

      IMMDevice *device;
      IAudioClient *client;
      IAudioRenderClient *render_client;
      HANDLE event_handle;
      HANDLE thread_priority_handle;

      /* 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 to be written to the device we
       * will pass this to GstAudioRingbuffer so it can to it translate
       * from the native GStreamer channel layout. */
      GstAudioChannelPosition *positions;

      /* properties */
      gint role;
      gint sharemode;
      gboolean mute;
      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 `“mute”` property

      “mute”                     gboolean

Mute state of this stream

Flags: Read / Write

Default value: FALSE

### 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: TRUE