From 87d5118eff09db8a781a1d6d465096f9ec2362e2 Mon Sep 17 00:00:00 2001 From: muschellij2 Date: Tue, 14 Jan 2020 10:26:46 -0500 Subject: [PATCH 01/10] updated roxygen2 --- DESCRIPTION | 2 +- man/ari_narrate.Rd | 19 ++++++++++++++----- man/ari_spin.Rd | 11 +++++++++-- man/ari_stitch.Rd | 25 ++++++++++++++++++------- man/ari_talk.Rd | 8 ++++++-- 5 files changed, 48 insertions(+), 17 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2a01346..6d0f606 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -38,5 +38,5 @@ URL: http://github.com/seankross/ari BugReports: http://github.com/seankross/ari/issues Encoding: UTF-8 LazyData: true -RoxygenNote: 6.1.1 +RoxygenNote: 7.0.1 VignetteBuilder: knitr diff --git a/man/ari_narrate.Rd b/man/ari_narrate.Rd index 0fed6c3..c3b6789 100644 --- a/man/ari_narrate.Rd +++ b/man/ari_narrate.Rd @@ -4,11 +4,20 @@ \alias{ari_narrate} \title{Create a video from slides and a script} \usage{ -ari_narrate(script, slides, output = tempfile(fileext = ".mp4"), - voice = "Joanna", service = "amazon", - capture_method = c("vectorized", "iterative"), subtitles = FALSE, - ..., verbose = FALSE, audio_codec = get_audio_codec(), - video_codec = get_video_codec(), cleanup = TRUE) +ari_narrate( + script, + slides, + output = tempfile(fileext = ".mp4"), + voice = "Joanna", + service = "amazon", + capture_method = c("vectorized", "iterative"), + subtitles = FALSE, + ..., + verbose = FALSE, + audio_codec = get_audio_codec(), + video_codec = get_video_codec(), + cleanup = TRUE +) } \arguments{ \item{script}{Either a markdown file where every paragraph will be read over diff --git a/man/ari_spin.Rd b/man/ari_spin.Rd index dbfa555..d17b109 100644 --- a/man/ari_spin.Rd +++ b/man/ari_spin.Rd @@ -4,8 +4,15 @@ \alias{ari_spin} \title{Create a video from images and text} \usage{ -ari_spin(images, paragraphs, output = tempfile(fileext = ".mp4"), - voice = "Joanna", service = "amazon", subtitles = FALSE, ...) +ari_spin( + images, + paragraphs, + output = tempfile(fileext = ".mp4"), + voice = "Joanna", + service = "amazon", + subtitles = FALSE, + ... +) } \arguments{ \item{images}{A vector of paths to images.} diff --git a/man/ari_stitch.Rd b/man/ari_stitch.Rd index f67078d..75abf65 100644 --- a/man/ari_stitch.Rd +++ b/man/ari_stitch.Rd @@ -4,13 +4,24 @@ \alias{ari_stitch} \title{Create a video from images and audio} \usage{ -ari_stitch(images, audio, output = tempfile(fileext = ".mp4"), - verbose = FALSE, cleanup = TRUE, ffmpeg_opts = "", - divisible_height = TRUE, audio_codec = get_audio_codec(), - video_codec = get_video_codec(), video_sync_method = "2", - audio_bitrate = NULL, video_bitrate = NULL, - pixel_format = "yuv420p", fast_start = TRUE, deinterlace = TRUE, - stereo_audio = TRUE) +ari_stitch( + images, + audio, + output = tempfile(fileext = ".mp4"), + verbose = FALSE, + cleanup = TRUE, + ffmpeg_opts = "", + divisible_height = TRUE, + audio_codec = get_audio_codec(), + video_codec = get_video_codec(), + video_sync_method = "2", + audio_bitrate = NULL, + video_bitrate = NULL, + pixel_format = "yuv420p", + fast_start = TRUE, + deinterlace = TRUE, + stereo_audio = TRUE +) } \arguments{ \item{images}{A vector of paths to images.} diff --git a/man/ari_talk.Rd b/man/ari_talk.Rd index 2df14c1..dd83746 100644 --- a/man/ari_talk.Rd +++ b/man/ari_talk.Rd @@ -4,8 +4,12 @@ \alias{ari_talk} \title{Create spoken audio files} \usage{ -ari_talk(paragraphs, output = tempfile(fileext = ".wav"), - voice = "Joanna", service = "amazon") +ari_talk( + paragraphs, + output = tempfile(fileext = ".wav"), + voice = "Joanna", + service = "amazon" +) } \arguments{ \item{paragraphs}{A vector strings that will be spoken by Amazon Polly.} From 89d59ebd62fb02115be512db283a26c9ba0901ab Mon Sep 17 00:00:00 2001 From: muschellij2 Date: Tue, 14 Jan 2020 10:35:51 -0500 Subject: [PATCH 02/10] updated the aws.polly check with tts --- NAMESPACE | 2 ++ R/ari_narrate.R | 4 ++-- R/ari_spin.R | 12 +++++++++--- R/ari_talk.R | 4 ++-- man/ari_narrate.Rd | 4 ++-- man/ari_spin.Rd | 7 +++++-- man/ari_talk.Rd | 4 ++-- tests/testthat.R | 8 +++++--- 8 files changed, 29 insertions(+), 16 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 605d9fc..040b201 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,6 +17,7 @@ export(ffmpeg_video_codecs) export(get_audio_codec) export(get_video_codec) export(have_ffmpeg_exec) +export(have_polly) export(set_audio_codec) export(set_video_codec) export(video_codec_encode) @@ -36,6 +37,7 @@ importFrom(rvest,html_nodes) importFrom(rvest,html_text) importFrom(text2speech,tts) importFrom(text2speech,tts_auth) +importFrom(text2speech,tts_default_voice) importFrom(tools,file_ext) importFrom(tools,file_path_sans_ext) importFrom(tuneR,Wave) diff --git a/R/ari_narrate.R b/R/ari_narrate.R index 183bf5c..9c3d77f 100644 --- a/R/ari_narrate.R +++ b/R/ari_narrate.R @@ -52,8 +52,8 @@ #' } ari_narrate <- function(script, slides, output = tempfile(fileext = ".mp4"), - voice = "Joanna", - service = "amazon", + voice = text2speech::tts_default_voice(service = service), + service = ifelse(have_polly(), "amazon", "google"), capture_method = c("vectorized", "iterative"), subtitles = FALSE, ..., verbose = FALSE, diff --git a/R/ari_spin.R b/R/ari_spin.R index 764fc92..5beb3e0 100644 --- a/R/ari_spin.R +++ b/R/ari_spin.R @@ -34,7 +34,7 @@ #' #' @return The output from \code{\link{ari_stitch}} #' -#' @importFrom text2speech tts_auth tts +#' @importFrom text2speech tts_auth tts tts_default_voice #' @importFrom tuneR bind Wave #' @importFrom purrr map reduce #' @importFrom progress progress_bar @@ -54,8 +54,8 @@ ari_spin <- function( images, paragraphs, output = tempfile(fileext = ".mp4"), - voice = "Joanna", - service = "amazon", + voice = text2speech::tts_default_voice(service = service), + service = ifelse(have_polly(), "amazon", "google"), subtitles = FALSE, ...){ # check for ffmpeg before any synthesizing @@ -135,4 +135,10 @@ ari_spin <- function( attr(res, "voice") = voice attr(res, "service") = service return(res) +} + +#' @rdname ari_spin +#' @export +have_polly = function() { + requireNamespace("aws.polly", quietly = TRUE) } \ No newline at end of file diff --git a/R/ari_talk.R b/R/ari_talk.R index fc55f7c..6d0f20d 100644 --- a/R/ari_talk.R +++ b/R/ari_talk.R @@ -17,8 +17,8 @@ #' @export ari_talk <- function(paragraphs, output = tempfile(fileext = ".wav"), - voice = "Joanna", - service = "amazon") { + voice = text2speech::tts_default_voice(service = service), + service = ifelse(have_polly(), "amazon", "google")) { auth = text2speech::tts_auth(service = service) if (!auth) { stop(paste0("It appears you're not authenticated with ", diff --git a/man/ari_narrate.Rd b/man/ari_narrate.Rd index c3b6789..1a9a842 100644 --- a/man/ari_narrate.Rd +++ b/man/ari_narrate.Rd @@ -8,8 +8,8 @@ ari_narrate( script, slides, output = tempfile(fileext = ".mp4"), - voice = "Joanna", - service = "amazon", + voice = text2speech::tts_default_voice(service = service), + service = ifelse(have_polly(), "amazon", "google"), capture_method = c("vectorized", "iterative"), subtitles = FALSE, ..., diff --git a/man/ari_spin.Rd b/man/ari_spin.Rd index d17b109..7521888 100644 --- a/man/ari_spin.Rd +++ b/man/ari_spin.Rd @@ -2,17 +2,20 @@ % Please edit documentation in R/ari_spin.R \name{ari_spin} \alias{ari_spin} +\alias{have_polly} \title{Create a video from images and text} \usage{ ari_spin( images, paragraphs, output = tempfile(fileext = ".mp4"), - voice = "Joanna", - service = "amazon", + voice = text2speech::tts_default_voice(service = service), + service = ifelse(have_polly(), "amazon", "google"), subtitles = FALSE, ... ) + +have_polly() } \arguments{ \item{images}{A vector of paths to images.} diff --git a/man/ari_talk.Rd b/man/ari_talk.Rd index dd83746..1443d4b 100644 --- a/man/ari_talk.Rd +++ b/man/ari_talk.Rd @@ -7,8 +7,8 @@ ari_talk( paragraphs, output = tempfile(fileext = ".wav"), - voice = "Joanna", - service = "amazon" + voice = text2speech::tts_default_voice(service = service), + service = ifelse(have_polly(), "amazon", "google") ) } \arguments{ diff --git a/tests/testthat.R b/tests/testthat.R index dc8c2ad..e0943ff 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -7,12 +7,14 @@ library(aws.polly) if (nzchar(Sys.getenv("AWS_ACCESS_KEY_ID"))) { if (!identical(Sys.getenv("TRAVIS"), "true")) { - aws.signature::use_credentials(profile = "polly") + aws.signature::use_credentials(profile = "polly") } } skip_amazon_not_authorized = function() { - if (text2speech::tts_amazon_authenticated()) { - return(invisible(TRUE)) + if (requireNamespace("aws.polly", quietly = TRUE)) { + if (text2speech::tts_amazon_authenticated()) { + return(invisible(TRUE)) + } } skip("Amazon not authenticated()") } From ba2549db7f70e2d1a5fe95858f7d1f79a2186fdf Mon Sep 17 00:00:00 2001 From: muschellij2 Date: Tue, 14 Jan 2020 10:40:07 -0500 Subject: [PATCH 03/10] updating docs --- docs/404.html | 150 ++++ docs/LICENSE-text.html | 39 +- .../Simple-Ari-Configuration-with-Docker.html | 151 ++++ .../elevate-section-attrs.js | 20 + .../jquery-1.11.3/jquery.min.js | 5 + docs/articles/index.html | 154 ++++ docs/authors.html | 39 +- docs/index.html | 117 +-- docs/news/index.html | 74 +- docs/pkgdown.css | 46 +- docs/pkgdown.js | 14 +- docs/pkgdown.yml | 7 +- docs/reference/ari_burn_subtitles.html | 52 +- docs/reference/ari_example.html | 51 +- docs/reference/ari_narrate.html | 89 +- docs/reference/ari_spin.html | 84 +- docs/reference/ari_stitch.html | 94 ++- docs/reference/ari_talk.html | 62 +- docs/reference/codecs.html | 65 +- docs/reference/ffmpeg_codecs.html | 761 +----------------- docs/reference/ffmpeg_exec.html | 59 +- docs/reference/index.html | 41 +- 22 files changed, 1136 insertions(+), 1038 deletions(-) create mode 100644 docs/404.html create mode 100644 docs/articles/Simple-Ari-Configuration-with-Docker.html create mode 100644 docs/articles/Simple-Ari-Configuration-with-Docker_files/elevate-section-attrs-2.0/elevate-section-attrs.js create mode 100644 docs/articles/Simple-Ari-Configuration-with-Docker_files/jquery-1.11.3/jquery.min.js create mode 100644 docs/articles/index.html diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..568e2b3 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,150 @@ + + + + + + + + +Page not found (404) • ari + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +Content not found. Please use links in the navbar. + +
+ +
+ + + +
+ + +
+

Site built with pkgdown 1.4.0.

+
+ +
+
+ + + + + + + + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 1774646..5c7b70e 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -8,21 +8,25 @@ License • ari + + - + + - - + + + @@ -30,10 +34,12 @@ + + @@ -44,6 +50,7 @@ + @@ -60,7 +67,7 @@ ari - 0.3.2 + 0.3.3 @@ -68,22 +75,33 @@ -