jhudsl / ari

:dancers: The Automated R Instructor
https://jhudatascience.org/ari/
Other
146 stars 38 forks source link

Allowed audio to be a character vector #13

Closed muschellij2 closed 5 years ago

muschellij2 commented 5 years ago

Allowed audio to be a character vector in ari_stitch. Should likely do some switching to whether read it in using readWave vs. readMP3.

My goal was to be able to use ari_stitch on Google's translated audio (a bit cheaper than Polly). Assume script had a bunch of paragraphs in there:

library(googleLanguageR)
library(ari)

para = script
para = trimws(para)
para = para[ para != "" ]
talk_res = sapply(para, function(x) {
  gl_talk(input = x,
          output = tempfile(fileext = ".mp3"),
          name = "en-US-Wavenet-C",
          audioEncoding = "MP3")
})

audio = talk_res

output = tempfile(fileext = ".mp4")
result = ari_stitch(images, audio = audio,
                    output = output)
muschellij2 commented 5 years ago

@seankross This now uses https://github.com/muschellij2/text2speech which will be on CRAN hopefully within the next 2-3 days. This allows for synthesis using Google, Microsoft, and Amazon in a unified way.

muschellij2 commented 5 years ago

This list of audio files using Google is a moot point with text2speech, but still passing Wave objects is still a good idea.

muschellij2 commented 5 years ago

Look good?

seankross commented 5 years ago

@muschellij2 are you ready to send this to CRAN?

muschellij2 commented 5 years ago

Looks good to me. I say merge and release.

muschellij2 commented 5 years ago

I got it to work on Appveyor: https://ci.appveyor.com/project/muschellij2/ari/builds/25868094, but I don't know about CRAN ffmpeg.