Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example in README not working as is #12

Open
moodymudskipper opened this issue Apr 3, 2021 · 0 comments
Open

Example in README not working as is #12

moodymudskipper opened this issue Apr 3, 2021 · 0 comments

Comments

@moodymudskipper
Copy link

moodymudskipper commented Apr 3, 2021

I had to change it to (see my comments inline) :

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
}

Thanks for this package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant