# GstAudioSrc

This is the most simple base class for audio sources that only requires subclasses to implement a set of simple functions:

- `open()` :Open the device.
- `prepare()` :Configure the device with the specified format.
- `read()` :Read samples from the device.
- `reset()` :Unblock reads and flush the device.
- `delay()` :Get the number of samples in the device but not yet read.
- `unprepare()` :Undo operations done by prepare.
- `close()` :Close the device.

All scheduling of samples and timestamps is done in this base class together with GstAudioBaseSrc using a default implementation of a GstAudioRingBuffer that uses threads.

## GstAudioSrc

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseSrc
                        ╰──GstPushSrc
                            ╰──GstAudioBaseSrc
                                ╰──GstAudioSrc

Base class for simple audio sources.

### Members

`element` (GstAudioBaseSrc) –
No description available

### Class structure

#### GstAudioSrcClass

GstAudioSrc class. Override the vmethod to implement functionality.

##### Fields

`parent_class` (GstAudioBaseSrcClass) –

the parent class.

### GstAudio.AudioSrcClass

GstAudio.AudioSrc class. Override the vmethod to implement functionality.

##### Attributes

`parent_class` (GstAudio.AudioBaseSrcClass) –

the parent class.

### GstAudio.AudioSrcClass

GstAudio.AudioSrc class. Override the vmethod to implement functionality.

##### Attributes

`parent_class` (GstAudio.AudioBaseSrcClass) –

the parent class.

## GstAudio.AudioSrc

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──GstBase.BaseSrc
                        ╰──GstBase.PushSrc
                            ╰──GstAudio.AudioBaseSrc
                                ╰──GstAudio.AudioSrc

Base class for simple audio sources.

### Members

`element` (GstAudio.AudioBaseSrc) –
No description available

## GstAudio.AudioSrc

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──GstBase.BaseSrc
                        ╰──GstBase.PushSrc
                            ╰──GstAudio.AudioBaseSrc
                                ╰──GstAudio.AudioSrc

Base class for simple audio sources.

### Members

`element` (GstAudio.AudioBaseSrc) –
No description available

### Virtual Methods

#### close

    gboolean
    close (GstAudioSrc * src)

close the device

Parameters:

`src` –
No description available
Returns –
No description available

#### vfunc_close

    function vfunc_close(src: GstAudio.AudioSrc): {
        // javascript implementation of the 'close' virtual method
    }

close the device

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
Returns (Number) –
No description available

#### do_close

    def do_close (src):
        #python implementation of the 'close' virtual method

close the device

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
Returns (bool) –
No description available

#### delay

    guint
    delay (GstAudioSrc * src)

the number of frames queued in the device

Parameters:

`src` –
No description available
Returns –
No description available

#### vfunc_delay

    function vfunc_delay(src: GstAudio.AudioSrc): {
        // javascript implementation of the 'delay' virtual method
    }

the number of frames queued in the device

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
Returns (Number) –
No description available

#### do_delay

    def do_delay (src):
        #python implementation of the 'delay' virtual method

the number of frames queued in the device

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
Returns (int) –
No description available

#### open

    gboolean
    open (GstAudioSrc * src)

open the device with the specified caps

Parameters:

`src` –
No description available
Returns –
No description available

#### vfunc_open

    function vfunc_open(src: GstAudio.AudioSrc): {
        // javascript implementation of the 'open' virtual method
    }

open the device with the specified caps

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
Returns (Number) –
No description available

#### do_open

    def do_open (src):
        #python implementation of the 'open' virtual method

open the device with the specified caps

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
Returns (bool) –
No description available

#### prepare

    gboolean
    prepare (GstAudioSrc * src,
             GstAudioRingBufferSpec * spec)

configure device with format

Parameters:

`src` –
No description available
`spec` –
No description available
Returns –
No description available

#### vfunc_prepare

    function vfunc_prepare(src: GstAudio.AudioSrc, spec: GstAudio.AudioRingBufferSpec): {
        // javascript implementation of the 'prepare' virtual method
    }

configure device with format

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
`spec` (GstAudio.AudioRingBufferSpec) –
No description available
Returns (Number) –
No description available

#### do_prepare

    def do_prepare (src, spec):
        #python implementation of the 'prepare' virtual method

configure device with format

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
`spec` (GstAudio.AudioRingBufferSpec) –
No description available
Returns (bool) –
No description available

#### read

    guint
    read (GstAudioSrc * src,
          gpointer data,
          guint length,
          GstClockTime * timestamp)

read samples from the audio device

Parameters:

`src` –
No description available
`data` –
No description available
`length` –
No description available
`timestamp` –
No description available
Returns –
No description available

#### vfunc_read

    function vfunc_read(src: GstAudio.AudioSrc, data: Object, length: Number, timestamp: Number): {
        // javascript implementation of the 'read' virtual method
    }

read samples from the audio device

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
`data` (Object) –
No description available
`length` (Number) –
No description available
`timestamp` (Number) –
No description available
Returns (Number) –
No description available

#### do_read

    def do_read (src, data, length, timestamp):
        #python implementation of the 'read' virtual method

read samples from the audio device

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
`data` (object) –
No description available
`length` (int) –
No description available
`timestamp` (int) –
No description available
Returns (int) –
No description available

#### reset

    reset (GstAudioSrc * src)

unblock a read to the device and reset.

Parameters:

`src` –
No description available

#### vfunc_reset

    function vfunc_reset(src: GstAudio.AudioSrc): {
        // javascript implementation of the 'reset' virtual method
    }

unblock a read to the device and reset.

Parameters:

`src` (GstAudio.AudioSrc) –
No description available

#### do_reset

    def do_reset (src):
        #python implementation of the 'reset' virtual method

unblock a read to the device and reset.

Parameters:

`src` (GstAudio.AudioSrc) –
No description available

#### unprepare

    gboolean
    unprepare (GstAudioSrc * src)

undo the configuration

Parameters:

`src` –
No description available
Returns –
No description available

#### vfunc_unprepare

    function vfunc_unprepare(src: GstAudio.AudioSrc): {
        // javascript implementation of the 'unprepare' virtual method
    }

undo the configuration

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
Returns (Number) –
No description available

#### do_unprepare

    def do_unprepare (src):
        #python implementation of the 'unprepare' virtual method

undo the configuration

Parameters:

`src` (GstAudio.AudioSrc) –
No description available
Returns (bool) –
No description available

The results of the search are