directsoundsink

directsoundsink

Types and Values

Description

This element lets you output sound using the DirectSound API.

Note that you should almost always use generic audio conversion elements like audioconvert and audioresample in front of an audiosink to make sure your pipeline works under all circumstances (those conversion elements will act in passthrough-mode if no conversion is necessary).

Example pipelines

1
gst-launch-1.0 -v audiotestsrc ! audioconvert ! volume volume=0.1 ! directsoundsink
will output a sine wave (continuous beep sound) to your sound card (with a very low volume as precaution).
1
gst-launch-1.0 -v filesrc location=music.ogg ! decodebin ! audioconvert ! audioresample ! directsoundsink
will play an Ogg/Vorbis audio file and output it.

Synopsis

Element Information

plugin

directsound

author

Sebastien Moutte <sebastien@moutte.net>

class

Sink/Audio

Element Pads

Functions

Types and Values

struct GstDirectSoundSink

struct GstDirectSoundSink {
  GstAudioSink sink;


  /* directsound object interface pointer */
  LPDIRECTSOUND pDS;

  /* directsound sound object interface pointer */
  LPDIRECTSOUNDBUFFER pDSBSecondary;

  /* directSound buffer size */
  guint buffer_size;

  /* offset of the circular buffer where we must write next */
  guint current_circular_offset;

  guint bytes_per_sample;

  /* current volume setup by mixer interface */
  glong volume;
  gboolean mute;
  
  /* current directsound device ID */
  gchar * device_id;

  GstCaps *cached_caps;
  /* lock used to protect writes and resets */
  GMutex dsound_lock;

  gboolean first_buffer_after_reset;

  GstAudioRingBufferFormatType type;
};