Skip to contents

Coerces a supported object into a syn_media object carrying its content, a type tag ("text", "image", "audio", "score"), and metadata. This is the common currency that lets images, audio, text, and prosody scores be passed freely between synesthR functions.

Usage

as_syn_media(x, ...)

# S3 method for class 'syn_media'
as_syn_media(x, ...)

# S3 method for class 'prosody_score'
as_syn_media(x, ...)

# S3 method for class 'character'
as_syn_media(x, ...)

# S3 method for class 'Wave'
as_syn_media(x, ...)

# S3 method for class '`magick-image`'
as_syn_media(x, ...)

# Default S3 method
as_syn_media(x, ...)

Arguments

x

A character string/tibble (text), magick-image (image), tuneR::Wave (audio), or prosody_score (score).

...

Passed to methods.

Value

A syn_media object.

Examples

m <- as_syn_media("A quiet morning by the sea.")
m
#> <syn_media> of type "text"
score <- syn_score(syn_read_text(syn_example_text("en"), lang = "en"))
media_type(as_syn_media(score))
#> [1] "score"