| provide_audio | R Documentation |
Designed for inline use in R Markdown, e.g.
`r provide_audio("media/klammer.wav")`.
provide_audio(
path,
mime = NULL,
method = c("object", "audio"),
warn_size_mb = 5
)
path |
Path to the local audio file. |
mime |
MIME type. If NULL, it is guessed from the extension. |
method |
Rendering method:
|
warn_size_mb |
Warn if file is larger than this many MB. |
The function reads a local audio file, encodes it as Base64, and returns either:
an HTML <object> tag
or an HTML <audio> tag
This makes the final XML/HTML fully self-contained.
knitr_asis object containing embedded audio HTML.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.