## SwfdecAudio

SwfdecAudio — object used for audio output

## Synopsis

    #include <swfdec/swfdec.h>

                        SwfdecAudio;
    void                swfdec_audio_render                 (SwfdecAudio *audio,
                                                             gint16 *dest,
                                                             guint start_offset,
                                                             guint n_samples);

## Object Hierarchy

      GObject
       +----SwfdecAudio

## Description

SwfdecAudio is the way audio output is provided by a SwfdecPlayer. See its documentation on how to access SwfdecAudio objects.

An audio object gives access to one audio stream played inside a player. You are responsible for outputting this data, swfdec does not try to do this for you.

Audio data is always provided in 16bit host-endian stereo. If the data was encoded into a different format originally, Swfdec will already have decoded it. The data is always referenced relative to the player. Sample 0 references the first sample to be played at the current position. If the player gets iterated, sample 0 changes. There is no way to access samples belonging to a previous state.

## Details

### SwfdecAudio

    typedef struct _SwfdecAudio SwfdecAudio;

This object is used for audio output. It is an abstract class.

### swfdec_audio_render ()

    void                swfdec_audio_render                 (SwfdecAudio *audio,
                                                             gint16 *dest,
                                                             guint start_offset,
                                                             guint n_samples);

Renders the samples from `audio` into the area pointed to by `dest`. The data is added to `dest`, so you probably want to initialize `dest` to silence before calling this function.

`audio` : | a SwfdecAudio
`dest` : | memory area to render to
`start_offset` : | offset in samples at which to start rendering. The offset is calculated relative to the last iteration, so the value set by `swfdec_player_set_audio_advance()` is ignored.
`n_samples` : | amount of samples to render.

## See Also

SwfdecPlayer