Speech

Qualified name: algan.animation\_timeline.animation\_contexts.Speech

class Speech(transcript, *, wait_at_end=1.0, **kwargs)[source]

Bases: Audio

Narrate a line, and fit the block’s animations to how long it takes to say.

The script text is looked up in the Scene’s audio manager, and the block runs for exactly as long as that narration. Write the sentence, animate what should happen while it is spoken, and the timing follows – which is how a whole explanatory video stays in sync with its voiceover.

Parameters:
  • transcript – The line of narration to play. It is appended to the Scene’s transcript and used to select the matching audio.

  • wait_at_end (float) – Extra seconds to hold after the line finishes. Defaults to 1, leaving a beat between sentences.

  • **kwargs (Any) – Passed to Audio.

Examples

with Speech("Now watch what happens when we double it."):
    square.scale(2)

Methods

Attributes

animation_manager

child_contexts

combine_easing

composed_easing

current_time

Where the authoring cursor sits within this context, in seconds.

easing

end_time

The furthest time anything recorded in this context reaches, in seconds.

equalize_runtimes

finished

kwargs

lag_ratio

new_animation

new_mobs

prev_context

priority_level

record_attr_modifications

record_funcs

runtime

runtime_per_part

spawn_at_end