Swfdec Reference Manual | ||||
---|---|---|---|---|
#include <swfdec/swfdec.h> SwfdecAudio; gsize swfdec_audio_render (SwfdecAudio *audio, gint16 *dest, gsize start_offset, gsize n_samples);
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.
typedef struct _SwfdecAudio SwfdecAudio;
This object is used for audio output. It is an abstract class.
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.
|
a SwfdecAudio |
|
memory area to render to |
|
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.
|
|
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.
|
"changed"
signalvoid user_function (SwfdecAudio *audio, gpointer user_data) : Run Last
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.
|
the SwfdecAudio affected |
|
user data set when the signal handler was connected. |
"new-data"
signalvoid user_function (SwfdecAudio *audio, gpointer user_data) : Run Last
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.
|
the SwfdecAudio affected |
|
user data set when the signal handler was connected. |