library(mscstts)
if (ms_have_tts_key(api_key = "c7611c44ed05426088dc2bf4c762bf65")) {
res = ms_synthesize(
region ="westeurope", # default seems to be the first of `ms_regions()` i.e. "westus"
script = "hey, how are you doing? I'm doing pretty good",
output_format = "audio-16khz-128kbitrate-mono-mp3")
tmp <- tempfile("example", fileext = ".mp3")
writeBin(res$content, con = tmp)
mp3 = tuneR::readMP3(tmp)
}
testthat::expect_true(file.size(tmp) > 50000)
if (interactive()) {
tuneR::play(mp3) # player = "play" wasn't recognized, probably because I'm on windows, removing the default worked ok
}
I had to change it to (see my comments inline) :
Thanks for this package!