Creates a page for the participant to calibrate their volume, using example audio, and the volume controls on their computer.

volume_calibration_page(
  url,
  type = tools::file_ext(url),
  prompt = NULL,
  button_text = "Next",
  on_complete = NULL,
  admin_ui = NULL,
  btn_play_prompt = "Click here to play",
  wait = FALSE,
  loop = TRUE,
  show_controls = FALSE
)

Arguments

url

URL to the audio. Can be an absolute URL (e.g. "http://mysite.com/audio.mp3") or a URL relative to the /www directory (e.g. "audio.mp3").

type

Audio type (e.g. 'mp3'). Defaults to the provided file extension.

prompt

Prompt to be displayed. If left NULL, a sensible English prompt is provided.

button_text

Button text (character scalar).

on_complete

Optional function to execute on leaving the page (after successful validation). The argument list should include ..., and any of: state, the participant's state object; answer, the participant's most recent answer; input, the current page's Shiny input object; session, the current Shiny session object; opt, the test's option list as created by test_options().

admin_ui

Optional UI component for the admin panel.

btn_play_prompt

Text to display as a prompt for starting the audio. Ordinarily the participant will not see this, but it might appear if the internet connection is poor, or if the participant refreshes the page. Only used if show_controls is FALSE.

wait

Wait parameter for HTML-5 audio element (logical scalar).

loop

Loop parameter for HTML-5 audio element (logical scalar).

show_controls

show_controls parameter for HTML-5 audio element (logical scalar).