swfdec.Audio

swfdec.Audio — Object used for audio output.

Synopsis

class swfdec.Audio(gobject.GObject):
    def render(dest, start_offset, n_samples)

Ancestry

+-- gobject.GObject
	+-- swfdec.Audio

Description

SwfdecAudio is the way audio output is provided by a swfdec.Player See its documentation on how to access swfdec.Audio 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.

Methods

swfdec.Audio.render

    def render(dest, start_offset, n_samples)

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.advance() is ignored.

n_samples :

Amount of samples to render.

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.