Skip to contents

Animates the element cloud across the narrative, revealing it sentence by sentence so the emotional arc unfolds in time. Requires gganimate.

Usage

syn_animate(score, ...)

Arguments

score

A prosody_score from syn_score().

...

Passed to gganimate::transition_states().

Value

A gganimate animation object. Requires gganimate.

See also

Other rendering functions: syn_paint(), syn_play(), syn_play_gm(), syn_write_wav()

Examples

score <- syn_score(syn_read_text(syn_example_text("en"), lang = "en"))
anim <- syn_animate(score)
class(anim)
#> [1] "gganim"          "ggplot2::ggplot" "ggplot"          "ggplot2::gg"    
#> [5] "S7_object"       "gg"             
# \donttest{
# Rendering the frames takes a while and needs a gganimate renderer.
frames <- gganimate::animate(
  anim, nframes = 10, fps = 5,
  renderer = gganimate::file_renderer(tempdir(), prefix = "syn_frame")
)
unlink(frames)
# }