SourceGroup Class

Inheritance diagram of SourceGroup

class SourceGroup(audio_format, video_format)

Read data from a queue of sources, with support for looping. All sources must share the same audio format.

Variables:audio_format – Required audio format for queued sources.

Constructor:

__init__(audio_format, video_format)

Methods:

get_audio_data(bytes) Get next audio packet.
get_current_source()
get_next_video_frame() Get the next video frame.
get_next_video_timestamp() Get the timestamp of the next video frame.
has_next()
next([immediate])
next_source([immediate])
queue(source)
seek(time)
translate_timestamp(timestamp) Get source-relative timestamp for the audio player’s timestamp.

Attributes:

loop Loop the current source indefinitely or until next is called.

Methods

SourceGroup.get_audio_data(bytes)

Get next audio packet.

Parameters:bytes (int) – Hint for preferred size of audio packet; may be ignored.
Return type:AudioData
Returns:Audio data, or None if there is no more data.
SourceGroup.get_current_source()
SourceGroup.get_next_video_frame()

Get the next video frame.

Video frames may share memory: the previous frame may be invalidated or corrupted when this method is called unless the application has made a copy of it.

Return type:pyglet.image.AbstractImage
Returns:The next video frame image, or None if the video frame could not be decoded or there are no more video frames.
SourceGroup.get_next_video_timestamp()

Get the timestamp of the next video frame.

Return type:float
Returns:The next timestamp, or None if there are no more video frames.
SourceGroup.has_next()
SourceGroup.next(immediate=True)

Warning

Deprecated. Use next_source instead.

SourceGroup.next_source(immediate=True)
SourceGroup.queue(source)
SourceGroup.seek(time)
SourceGroup.translate_timestamp(timestamp)

Get source-relative timestamp for the audio player’s timestamp.

Attributes

SourceGroup.loop

Loop the current source indefinitely or until next is called. Initially False.

Type:bool

Table Of Contents

Previous topic

Source Class

Next topic

SourceInfo Class