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

README and Function Documentation #22

Merged
merged 11 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@

export("%>%")
export(pcm_to_wav)
export(play_audio)
export(set_coqui_path)
export(tts)
export(tts_amazon)
export(tts_amazon_auth)
export(tts_amazon_authenticated)
export(tts_amazon_voices)
export(tts_auth)
export(tts_bind_wav)
export(tts_coqui)
export(tts_coqui_installed)
export(tts_coqui_auth)
export(tts_coqui_voices)
export(tts_default_voice)
export(tts_google)
export(tts_google_auth)
export(tts_google_authenticated)
export(tts_google_voices)
export(tts_microsoft)
export(tts_microsoft_auth)
export(tts_microsoft_authenticated)
export(tts_microsoft_voices)
export(tts_speak_engine)
export(tts_voices)
importFrom(cli,cli_text)
importFrom(magrittr,"%>%")
importFrom(tidyr,separate_wider_delim)
importFrom(utils,browseURL)
importFrom(withr,with_path)
26 changes: 25 additions & 1 deletion R/aaa_utils.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
#' Play audio in a browser
#'
#' This uses HTML5 audio tags to play audio in your browser.
#'
#' Borrowed from \code{googleLanguageR::gl_talk_player()}
#'
#' @param audio The file location of the audio file. Must be supported by HTML5
#' @param html The html file location that will be created host the audio
#'
#' @export
#' @importFrom utils browseURL
play_audio <- function(audio = "output.wav",
html = "player.html"){
# Write html code to a html file
writeLines(sprintf('<html><body>
<audio controls autoplay>
<source src="%s">
</audio>
</body></html>',
audio),
html)
# Load URL into browser
utils::browseURL(html)
}

# Read WAV or MP3 files in and store as a Wave object
tts_audio_read <- function(file,
output_format = c("wav", "mp3")) {
Expand Down Expand Up @@ -50,7 +75,6 @@ wav_duration = function(object) {
}
}


#' Point to local coqui tts Executable File
#'
#' Function to set an option that points to the local coqui tts Executable File
Expand Down
Loading
Loading