Compiled date: r Sys.Date()

Last edited: 2018-11-29

License: r packageDescription("iSEE")[["License"]]

knitr::opts_chunk$set(
    collapse = TRUE,
    comment = "#>",
    error = FALSE,
    warning = FALSE,
    message = FALSE,
    crop = NULL
)
stopifnot(requireNamespace("htmltools"))
htmltools::tagList(rmarkdown::html_dependency_font_awesome())
sce <- readRDS('sce.rds')

Feature

Using JavaScript, iSEE applications can leverage lightweight speech recognition libraries that react to specific vocal commands (think "OK Google", "Hey Siri") and trigger updates of the UI equivalent to one or more mouse or keyboard interaction with the UI components [@kra2018iSEE].

Note: As we value privacy, this feature is disabled by default: iSEE(..., voice=FALSE).

To keep the spoken commands reasonably short, only one panel may be under voice command at any one time. All spoken commands will affect the currently active panel, until a new panel is selected for voice command. See section Vocal commands available.

Implementation

We use the annyang lightweight JavaScript library to handle speech recognition and update Shiny reactive values in the same way as mouse and keyboard UI elements trigger panel updates.

Note that annyang requires an active internet connection, as it relies on the browser's own speech recognition engine (see the annyang FAQ). For instance, in Google Chrome, this engine performs the recognition in the cloud.

Supported web browsers

Note that the speech recognition library that we use does not work with every web browser. We currently only validated this feature in Google Chrome. Please refer to the annyang FAQ for details.

Usage

Using the sce object that we generated r Biocpkg("iSEE", vignette="basic.html", label="earlier"), enabling speech recognition is as simple as setting voice=TRUE below:

library(iSEE)
app <- iSEE(sce, voice=TRUE)

With voice=TRUE, the lightweight JavaScript speech recognition library annyang is loaded and activated in any web browser tab that runs app.

If your default browser is not compatible with the feature, or if you work in RStudio, you can prevent the application from opening in the default browser by setting launch.browser=FALSE as follows:

if (interactive()) {
    shiny::runApp(app, port=1234, launch.browser=FALSE)
}

At that point, your R console should be displaying the address and port where app is running. In the example above, that would be:

Listening on http://127.0.0.1:1234

Using a compatible browser, navigate to the indicated address and port. Note that when the web page opens, you may be prompted to allow the web browser to use your microphone, which you must accept to enable the functionality.

Vocal commands available {#availableVocalCommands}

As a proof of concept, only a subset of spoken commands are currently implemented, compared to the full range of interactions possible using the mouse and keyboard.

Note that in the commands below, words in brackets are optional.

Session Info {.unnumbered}

sessionInfo()
# devtools::session_info()

References {.unnumbered}



csoneson/iSEE documentation built on April 9, 2024, 3:17 p.m.