View source: R/headphoneTestUI.R
headphoneTestUI | R Documentation |
Create the user interface for a headphone screen using Huggins pitch or Antiphase phenomena.
headphoneTestUI(
id = "headphone_test",
type = c("huggins", "antiphase"),
n_trials = 6
)
id |
The Id of this module. Must match the Id of |
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 |
n_trials |
Integer. How many trials should be presented to each participant? Defaults to 6. Must match the n_trials argument of |
Creates the user interface for a headphone screen. Must be used with headphoneTestServer()
in the server function of the app.
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).
wwwPrep
, headphoneTestUI
Other headphone screen module:
headphoneTestServer()
## 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.