EventPoint#

class carb.audio.EventPoint#

Bases: pybind11_object

An event point parsed from a data file. This contains the ID of the event point, its name label (optional), and the frame in the stream at which it should occur.

Methods

__init__(self)

Attributes

frame

The frame that the event point occurs at.

id

The ID of the event point.

length

Length of the segment of audio referred to by this event point.

loop_count

Number of times this section of audio in the playlist should be played.

play_index

An optional method to specify an ordering for the event points or a subset of event points.

__init__(self: carb.audio._audio.EventPoint) None#
property frame#

The frame that the event point occurs at. This is relative to the start of the stream for the sound. When updating event points with `set_event_points()`, this can be set to `EVENT_POINT_INVALID_FRAME` to indicate that the event point with the ID `id` should be removed from the sound data object. Otherwise, this frame index must be within the bounds of the sound data object’s stream.

property id#

The ID of the event point. This is used to identify it in the file information but is not used internally except to match up labels or loop points to the event point.

property length#

Length of the segment of audio referred to by this event point. If `length` is non-zero, then `length` is treated as the number of frames after `frame` that this event point refers to. If `length` is zero, then this event point refers to the segment from `frame` to the end of the sound. If `loop_count` is non-zero, then the region specified will refer to a looping region. If `play_index` is non-zero, then the region can additionally specify the length of audio to play.

property loop_count#

Number of times this section of audio in the playlist should be played. The region of audio to play in a loop is specified by `length`. If `loop_count` is 0, then this is a non-looping segment. If `loop_count` is set to `EVENT_POINT_LOOP_INFINITE`, this specifies that this region should be looped infinitely.

property play_index#

An optional method to specify an ordering for the event points or a subset of event points. A value of 0 indicates that there is no intended ordering for this event point. The playlist indexes will always be a contiguous range starting from 1. If a user attempts to set a non-contiguous range of event point playlist indexes on a SoundData, the event point system will correct this and make the range contiguous.