Skip to content

Commit

Permalink
Merge pull request #22 from jhudsl/21-documentation
Browse files Browse the repository at this point in the history
README and Function Documentation
  • Loading branch information
howardbaek committed May 26, 2023
2 parents e93b87e + 9dadace commit 11388d1
Show file tree
Hide file tree
Showing 25 changed files with 820 additions and 709 deletions.
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

0 comments on commit 11388d1

Please sign in to comment.