SwfdecAudio

SwfdecAudio — object used for audio output

Functions

Signals

void changed Run Last
void new-data Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── SwfdecAudio

Includes

#include <swfdec/swfdec.h>

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.

Functions

swfdec_audio_render ()

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

Renders the samples from audio into the area pointed to by dest . Existing data in dest is overwritten.

Parameters

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.

 

Returns

The amount of samples actually rendered. Usually this number is equal to n_samples , but if you arrived at the end of stream or the stream is still loading, this number may be lower. It indicates that no more samples are available.

Types and Values

SwfdecAudio

typedef struct _SwfdecAudio SwfdecAudio;

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

Signal Details

The “changed” signal

void
user_function (SwfdecAudio *audio,
               gpointer     user_data)

This signal is emitted whenever the data of the audio changed and cached data should be rerendered. This happens for example when the volume of the audio is changed by the Flash file.

Parameters

audio

the SwfdecAudio affected

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “new-data” signal

void
user_function (SwfdecAudio *audio,
               gpointer     user_data)

This signal is emitted whenever new data was loaded into audio . You want to listen to this signal when swfdec_audio_render() previously returned less samples than you wanted to render.

Parameters

audio

the SwfdecAudio affected

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

See Also

SwfdecPlayer