## AgsAlsaDevout

AgsAlsaDevout — Output to soundcard

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | AGS_ALSA_DEVOUT_GET_OBJ_MUTEX()
GQuark | ags_alsa_devout_error_quark ()
gboolean | ags_alsa_devout_test_flags ()
void | ags_alsa_devout_set_flags ()
void | ags_alsa_devout_unset_flags ()
void | ags_alsa_devout_switch_buffer ()
void | ags_alsa_devout_adjust_delay_and_attack ()
void | ags_alsa_devout_realloc_buffer ()
AgsAlsaDevout * | ags_alsa_devout_new ()

## Properties

gpointer | attack | Read
double | bpm | Read / Write
gpointer | buffer | Read
guint | buffer-size | Read / Write
double | delay-factor | Read / Write
char * | device | Read / Write
guint | dsp-channels | Read / Write
guint | format | Read / Write
guint | pcm-channels | Read / Write
guint | samplerate | Read / Write

## Types and Values

#define | AGS_ALSA_DEVOUT_DEFAULT_ALSA_DEVICE
#define | AGS_ALSA_DEVOUT_DEFAULT_APP_BUFFER_SIZE
#define | AGS_ALSA_DEVOUT_DEFAULT_BACKEND_BUFFER_SIZE
enum | AgsAlsaDevoutFlags
enum | AgsAlsaDevoutAppBufferMode
enum | AgsAlsaDevoutBackendBufferMode
#define | AGS_ALSA_DEVOUT_ERROR
enum | AgsAlsaDevoutError

## Object Hierarchy

        GFlags
        ╰── AgsAlsaDevoutFlags
        GObject
        ╰── AgsAlsaDevout

## Includes

    #include <ags/audio/ags_alsa_devout.h>

## Description

AgsAlsaDevout represents a soundcard and supports output.

## Functions

### AGS_ALSA_DEVOUT_GET_OBJ_MUTEX()

    #define AGS_ALSA_DEVOUT_GET_OBJ_MUTEX(obj) (&(((AgsAlsaDevout *) obj)->obj_mutex))

### ags_alsa_devout_error_quark ()

    GQuark
    ags_alsa_devout_error_quark ();

### ags_alsa_devout_test_flags ()

    gboolean
    ags_alsa_devout_test_flags (AgsAlsaDevout *alsa_devout,
                                AgsAlsaDevoutFlags flags);

Test `flags` to be set on `alsa_devout` .

#### Parameters

alsa_devout | the AgsAlsaDevout |
flags | the flags |

#### Returns

`TRUE` if flags are set, else `FALSE`

Since: 3.13.2

### ags_alsa_devout_set_flags ()

    void
    ags_alsa_devout_set_flags (AgsAlsaDevout *alsa_devout,
                               AgsAlsaDevoutFlags flags);

Enable a feature of `alsa_devout` .

#### Parameters

alsa_devout | the AgsAlsaDevout |
flags | see AgsAlsaDevoutFlags |

Since: 3.13.2

### ags_alsa_devout_unset_flags ()

    void
    ags_alsa_devout_unset_flags (AgsAlsaDevout *alsa_devout,
                                 AgsAlsaDevoutFlags flags);

Disable a feature of `alsa_devout` .

#### Parameters

alsa_devout | the AgsAlsaDevout |
flags | see AgsAlsaDevoutFlags |

Since: 3.13.2

### ags_alsa_devout_switch_buffer ()

    void
    ags_alsa_devout_switch_buffer (AgsAlsaDevout *alsa_devout);

Switch currently played buffer.

#### Parameters

alsa_devout | the AgsAlsaDevout |

Since: 3.13.2

### ags_alsa_devout_adjust_delay_and_attack ()

    void
    ags_alsa_devout_adjust_delay_and_attack
                                   (AgsAlsaDevout *alsa_devout);

Calculate delay and attack and reset it.

#### Parameters

alsa_devout | the AgsAlsaDevout |

Since: 3.13.2

### ags_alsa_devout_realloc_buffer ()

    void
    ags_alsa_devout_realloc_buffer (AgsAlsaDevout *alsa_devout);

Reallocate the internal audio buffer.

#### Parameters

alsa_devout | the AgsAlsaDevout |

Since: 3.13.2

### ags_alsa_devout_new ()

    AgsAlsaDevout *
    ags_alsa_devout_new ();

Creates a new instance of AgsAlsaDevout.

#### Returns

the new AgsAlsaDevout

Since: 3.13.2

## Types and Values

### AGS_ALSA_DEVOUT_DEFAULT_ALSA_DEVICE

    #define AGS_ALSA_DEVOUT_DEFAULT_ALSA_DEVICE "hw:0,0"

### AGS_ALSA_DEVOUT_DEFAULT_APP_BUFFER_SIZE

    #define AGS_ALSA_DEVOUT_DEFAULT_APP_BUFFER_SIZE (4)

### AGS_ALSA_DEVOUT_DEFAULT_BACKEND_BUFFER_SIZE

    #define AGS_ALSA_DEVOUT_DEFAULT_BACKEND_BUFFER_SIZE (8)

### enum AgsAlsaDevoutFlags

Enum values to control the behavior or indicate internal state of AgsAlsaDevout by enable/disable as flags.

#### Members

AGS_ALSA_DEVOUT_INITIALIZED | the soundcard was initialized |
AGS_ALSA_DEVOUT_START_PLAY | playback starting |
AGS_ALSA_DEVOUT_PLAY | devout is running |
AGS_ALSA_DEVOUT_SHUTDOWN | stop playback |
AGS_ALSA_DEVOUT_NONBLOCKING | do non-blocking calls |
AGS_ALSA_DEVOUT_ATTACK_FIRST | use first attack, instead of second one |

### enum AgsAlsaDevoutAppBufferMode

Enum values to indicate internal state of AgsAlsaDevout application buffer by setting mode.

#### Members

AGS_ALSA_DEVOUT_APP_BUFFER_0 | ring-buffer 0 |
AGS_ALSA_DEVOUT_APP_BUFFER_1 | ring-buffer 1 |
AGS_ALSA_DEVOUT_APP_BUFFER_2 | ring-buffer 2 |
AGS_ALSA_DEVOUT_APP_BUFFER_3 | ring-buffer 3 |

### enum AgsAlsaDevoutBackendBufferMode

Enum values to indicate internal state of AgsAlsaDevout backend buffer by setting mode.

#### Members

AGS_ALSA_DEVOUT_BACKEND_BUFFER_0 | ring-buffer 0 |
AGS_ALSA_DEVOUT_BACKEND_BUFFER_1 | ring-buffer 1 |
AGS_ALSA_DEVOUT_BACKEND_BUFFER_2 | ring-buffer 2 |
AGS_ALSA_DEVOUT_BACKEND_BUFFER_3 | ring-buffer 3 |
AGS_ALSA_DEVOUT_BACKEND_BUFFER_4 | ring-buffer 4 |
AGS_ALSA_DEVOUT_BACKEND_BUFFER_5 | ring-buffer 5 |
AGS_ALSA_DEVOUT_BACKEND_BUFFER_6 | ring-buffer 6 |
AGS_ALSA_DEVOUT_BACKEND_BUFFER_7 | ring-buffer 7 |

### AGS_ALSA_DEVOUT_ERROR

    #define AGS_ALSA_DEVOUT_ERROR (ags_alsa_devout_error_quark())

### enum AgsAlsaDevoutError

#### Members

AGS_ALSA_DEVOUT_ERROR_LOCKED_SOUNDCARD |  |
AGS_ALSA_DEVOUT_ERROR_BROKEN_CONFIGURATION |  |
AGS_ALSA_DEVOUT_ERROR_ACCESS_TYPE_NOT_AVAILABLE |  |
AGS_ALSA_DEVOUT_ERROR_SAMPLE_FORMAT_NOT_AVAILABLE |  |
AGS_ALSA_DEVOUT_ERROR_CHANNELS_NOT_AVAILABLE |  |
AGS_ALSA_DEVOUT_ERROR_SAMPLERATE_NOT_AVAILABLE |  |
AGS_ALSA_DEVOUT_ERROR_BUFFER_SIZE_NOT_AVAILABLE |  |
AGS_ALSA_DEVOUT_ERROR_HW_PARAMETERS_NOT_AVAILABLE |  |

## Property Details

### The `“attack”` property

      “attack”                   gpointer

Attack of the buffer

Owner: AgsAlsaDevout

Flags: Read

Since: 3.13.2

### The `“bpm”` property

      “bpm”                      double

Beats per minute

Owner: AgsAlsaDevout

Flags: Read / Write

Allowed values: [1,240]

Default value: 120

Since: 3.13.2

### The `“buffer”` property

      “buffer”                   gpointer

The buffer

Owner: AgsAlsaDevout

Flags: Read

Since: 3.13.2

### The `“buffer-size”` property

      “buffer-size”              guint

The buffer size

Owner: AgsAlsaDevout

Flags: Read / Write

Allowed values: [16,16384]

Default value: 2048

Since: 3.13.2

### The `“delay-factor”` property

      “delay-factor”             double

tact

Owner: AgsAlsaDevout

Flags: Read / Write

Allowed values: [0,16]

Default value: 1

Since: 3.13.2

### The `“device”` property

      “device”                   char *

The alsa soundcard indentifier

Owner: AgsAlsaDevout

Flags: Read / Write

Default value: "hw:0,0"

Since: 3.13.2

### The `“dsp-channels”` property

      “dsp-channels”             guint

The dsp channel count

Owner: AgsAlsaDevout

Flags: Read / Write

Allowed values: [1,64]

Default value: 2

Since: 3.13.2

### The `“format”` property

      “format”                   guint

The precision of the buffer

Owner: AgsAlsaDevout

Flags: Read / Write

Default value: 16

Since: 3.13.2

### The `“pcm-channels”` property

      “pcm-channels”             guint

The pcm channel count

Owner: AgsAlsaDevout

Flags: Read / Write

Allowed values: [1,64]

Default value: 2

Since: 3.13.2

### The `“samplerate”` property

      “samplerate”               guint

The samplerate

Owner: AgsAlsaDevout

Flags: Read / Write

Allowed values: [8000,5644800]

Default value: 44100

Since: 3.13.2