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
)
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").
Audio type (e.g. 'mp3'). Defaults to the provided file extension.
Prompt to be displayed. If left NULL
,
a sensible English prompt is provided.
Button text (character scalar).
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()
.
Optional UI component for the admin panel.
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 parameter for HTML-5 audio element (logical scalar).
Loop parameter for HTML-5 audio element (logical scalar).
show_controls parameter for HTML-5 audio element (logical scalar).