## Spice Audio

Spice Audio — a helper to play and to record audio channels

## Stability Level

Stable, unless otherwise indicated

## Functions

SpiceAudio * | spice_audio_get ()
SpiceAudio * | spice_audio_new ()

## Properties

GMainContext * | main-context | Read / Write / Construct Only
SpiceSession * | session | Read / Write / Construct Only

## Types and Values

struct | SpiceAudio
struct | SpiceAudioClass

## Object Hierarchy

        GObject
        ╰── SpiceAudio

## Includes

    #include <spice-client.h>

## Description

A class that handles the playback and record channels for your application, and connect them to the default sound system.

## Functions

### spice_audio_get ()

    SpiceAudio *
    spice_audio_get (SpiceSession *session,
                     GMainContext *context);

Gets the SpiceAudio associated with the passed in SpiceSession. A new SpiceAudio instance will be created the first time this function is called for a certain SpiceSession.

Note that this function returns a weak reference, which should not be used after the SpiceSession itself has been unref-ed by the caller.

#### Parameters

session | the SpiceSession to connect to |
context | a GMainContext to attach to (or `NULL` for default). | [allow-none]

#### Returns

a weak reference to a SpiceAudio instance or `NULL` if failed.

[transfer none]

### spice_audio_new ()

    SpiceAudio *
    spice_audio_new (SpiceSession *session,
                     GMainContext *context,
                     const char *name);

`spice_audio_new` has been deprecated since version 0.8 and should not be used in newly-written code.

Use `spice_audio_get()` instead

Once instantiated, SpiceAudio will handle the playback and record channels to stream to your local audio system.

#### Parameters

session | the SpiceSession to connect to |
context | a GMainContext to attach to (or `NULL` for default). | [allow-none]
name | a name for the audio channels (or `NULL` for application name). | [allow-none]

#### Returns

a new SpiceAudio instance or `NULL` if no backend or failed.

## Types and Values

### struct SpiceAudio

    struct SpiceAudio;

The SpiceAudio struct is opaque and should not be accessed directly.

### struct SpiceAudioClass

    struct SpiceAudioClass {
        GObjectClass parent_class;
    };

Class structure for SpiceAudio.

#### Members

## Property Details

### The `“main-context”` property

      “main-context”             GMainContext *

GMainContext to use for the event source.

Owner: SpiceAudio

Flags: Read / Write / Construct Only

### The `“session”` property

      “session”                  SpiceSession *

SpiceSession this SpiceAudio is associated with

Owner: SpiceAudio

Flags: Read / Write / Construct Only

## See Also

SpiceRecordChannel, and SpicePlaybackChannel