headphoneTestUI: UI function for the Headphone Test Module

View source: R/headphoneTestUI.R

headphoneTestUIR Documentation

UI function for the Headphone Test Module

Description

Create the user interface for a headphone screen using Huggins pitch or Antiphase phenomena.

Usage

headphoneTestUI(
  id = "headphone_test",
  type = c("huggins", "antiphase"),
  n_trials = 6
)

Arguments

id

The Id of this module. Must match the Id of headphoneTestServer. Defaults to "headphone_test".

type

Whether to use the Huggins Pitch headphone screen (see Milne et al., 2020) or the Antiphase headphone screen (Woods et al., 2017). Must be one of "huggins" or "antiphase" and must match the value given in headphoneTestServer().

n_trials

Integer. How many trials should be presented to each participant? Defaults to 6. Must match the n_trials argument of headphoneTestServer

Value

Creates the user interface for a headphone screen. Must be used with headphoneTestServer() in the server function of the app.

References

Milne, A.E., Bianco, R., Poole, K.C., Zhao, S., Oxenham, A.J., Billing, A.J., & Chait, M. 2020. An online headphone screening test based on dichotic pitch.Behavior Research Methods 53, 1551-1562 (2021). Woods, K.J.P., Siegel, M.H., Traer, J., & McDermott, J.H. 2017. Headphone screening to facilitate web-based auditory experiments. Attention, Perception, & Psychophysics 79, 2064-2072 (2017).

See Also

wwwPrep, headphoneTestUI

Other headphone screen module: headphoneTestServer()

Examples

## First use wwwPrep() to get the data for the type of headphone screen you want.
## NOTE: Do NOT put this command in your UI!
## Run it once before testing your app to create the www folder.
wwwPrep(HugginsPitchScreen = TRUE)

# Now build the app.
if (interactive()) {
 ui <- fluidPage(
        headphoneTestUI(id = "headphone_test", type = "huggins")
     )

 server <- function(input, output, session) {
                           headphoneTestServer(id = "headphone_test", type = "huggins",
                                                n_trials = 6, threshold = 4, n_attempts = 2)
  }
shinyApp(ui = ui, server = server)
}

abbey-thomas/speechcollectr documentation built on Nov. 19, 2024, 7:09 p.m.