psychos.sound.StaticSource#
- class psychos.sound.StaticSource(source: Source)[source]#
Bases:
SourceA source that has been completely decoded in memory.
This source can be queued onto multiple players any number of times.
Construct a
StaticSourcefor the data insource.- Parameters:
source (Source) – The source to read and decode audio and video data from.
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.
Return the
Sourceto 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_formatdurationThe length of the source, in seconds.
infois_player_sourcevideo_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 aStaticMemorySourcecontaining its internal audio data and audio format.- Raises:
- get_queue_source() StaticMemorySource | None[source]#
Return the
Sourceto be used as the queue source for a player.Default implementation returns
self.- Returns:
Source