psychos.sound.StaticSource#

class psychos.sound.StaticSource(source: Source)[source]#

Bases: Source

A source that has been completely decoded in memory.

This source can be queued onto multiple players any number of times.

Construct a StaticSource for the data in source.

Parameters:

source (Source) – The source to read and decode audio and video data from.

__init__(source: Source) None[source]#

Methods

__init__(source)

get_animation()

Import all video frames into memory.

get_audio_data(num_bytes[, compensation_time])

The StaticSource does not provide audio data.

get_next_video_frame()

Get the next video frame.

get_next_video_timestamp()

Get the timestamp of the next video frame.

get_queue_source()

Return the Source to be used as the queue source for a player.

is_precise()

bool: Whether this source is considered precise.

play()

Play the source.

save(filename[, file, encoder])

Save this Source to a file.

seek(timestamp)

Seek to given timestamp.

Attributes

audio_format

duration

The length of the source, in seconds.

info

is_player_source

video_format

get_audio_data(num_bytes: float, compensation_time: float = 0.0) AudioData | None[source]#

The StaticSource does not provide audio data.

When the StaticSource is queued on a Player, it creates a StaticMemorySource containing its internal audio data and audio format.

Raises:

RuntimeError

get_queue_source() StaticMemorySource | None[source]#

Return the Source to be used as the queue source for a player.

Default implementation returns self.

Returns:

Source