diff --git a/curriculum/challenges/english/25-front-end-development/quiz-javascript-audio-and-video/66edd3b3096349f06cf688bb.md b/curriculum/challenges/english/25-front-end-development/quiz-javascript-audio-and-video/66edd3b3096349f06cf688bb.md index a006efed235..a69c0d7d84c 100644 --- a/curriculum/challenges/english/25-front-end-development/quiz-javascript-audio-and-video/66edd3b3096349f06cf688bb.md +++ b/curriculum/challenges/english/25-front-end-development/quiz-javascript-audio-and-video/66edd3b3096349f06cf688bb.md @@ -17,439 +17,449 @@ To pass the quiz, you must correctly answer at least 17 of the 20 of the questio #### --text-- -Placeholder question +What is the purpose of the `Audio()` constructor in JavaScript? #### --distractors-- -Placeholder distractor 1 +Create a new audio file --- -Placeholder distractor 2 +Play an existing audio file --- -Placeholder distractor 3 +Modify audio files #### --answer-- -Placeholder answer +Create and manipulate a new `audio` element ### --question-- #### --text-- -Placeholder question +Which method is used to begin playback of an `audio` or `video` element? #### --distractors-- -Placeholder distractor 1 +`start()` --- -Placeholder distractor 2 +`begin()` --- -Placeholder distractor 3 +`resume()` #### --answer-- -Placeholder answer +`play()` ### --question-- #### --text-- -Placeholder question +What is the difference between `pause()` and `stop()` methods for media elements? #### --distractors-- -Placeholder distractor 1 +There is no difference, they are synonyms --- -Placeholder distractor 2 +`pause()` stops playback permanently, while `stop()` allows resuming --- -Placeholder distractor 3 +`pause()` allows resuming playback, while `stop()` resets to the beginning #### --answer-- -Placeholder answer +`stop()` is not a valid method for media elements ### --question-- #### --text-- -Placeholder question +Which audio format has the widest browser support? #### --distractors-- -Placeholder distractor 1 +`FLAC` --- -Placeholder distractor 2 +`OGG` --- -Placeholder distractor 3 +`WAV` #### --answer-- -Placeholder answer +`MP3` ### --question-- #### --text-- -Placeholder question +What is the purpose of the `source` element within an `audio` or `video` element? #### --distractors-- -Placeholder distractor 1 +Specify the volume of the media --- -Placeholder distractor 2 +Add subtitles to the media --- -Placeholder distractor 3 +Link to an external audio processor #### --answer-- -Placeholder answer +Specify multiple media sources for different formats ### --question-- #### --text-- -Placeholder question +Which of the following is NOT a valid video format for web use? #### --distractors-- -Placeholder distractor 1 +`MP4` --- -Placeholder distractor 2 +`WebM` --- -Placeholder distractor 3 +`Ogg` #### --answer-- -Placeholder answer +`AVI` ### --question-- #### --text-- -Placeholder question +What does a codec do in the context of audio and video? #### --distractors-- -Placeholder distractor 1 +Increases the volume of the media --- -Placeholder distractor 2 +Changes the file format of the media --- -Placeholder distractor 3 +Encrypts the media for secure transmission #### --answer-- -Placeholder answer +Compresses and decompresses digital media ### --question-- #### --text-- -Placeholder question +Which API provides a way to create, process, and analyze audio in web applications? #### --distractors-- -Placeholder distractor 1 +Audio Processing API --- -Placeholder distractor 2 +Sound Manipulation API --- -Placeholder distractor 3 +Media Stream API #### --answer-- -Placeholder answer +Web Audio API ### --question-- #### --text-- -Placeholder question +What is the purpose of the `getUserMedia()` method? #### --distractors-- -Placeholder distractor 1 +Authenticate users with a media service --- -Placeholder distractor 2 +Retrieve user preferences for media playback --- -Placeholder distractor 3 +Download media files to the user's device #### --answer-- -Placeholder answer +Access the user's camera and/or microphone ### --question-- #### --text-- -Placeholder question +Which property of the `HTMLMediaElement` interface represents the current playback time? #### --distractors-- -Placeholder distractor 1 +`time` --- -Placeholder distractor 2 +`playbackPosition` --- -Placeholder distractor 3 +`currentPosition` #### --answer-- -Placeholder answer +`currentTime` ### --question-- #### --text-- -Placeholder question +What does the following code snippet do? + +```javascript +const audio = new Audio('song.mp3'); +audio.loop = true; +``` #### --distractors-- -Placeholder distractor 1 +Plays the audio file once --- -Placeholder distractor 2 +Increases the volume of the audio --- -Placeholder distractor 3 +Pauses the audio after one loop #### --answer-- -Placeholder answer +Sets the audio to repeat indefinitely ### --question-- #### --text-- -Placeholder question +Which method is used to capture a media stream from a `canvas` element? #### --distractors-- -Placeholder distractor 1 +`canvas.getStream()` --- -Placeholder distractor 2 +`canvas.captureMedia()` --- -Placeholder distractor 3 +`canvas.toDataURL()` #### --answer-- -Placeholder answer +`canvas.captureStream()` ### --question-- #### --text-- -Placeholder question +What is the purpose of the `MediaRecorder` API? #### --distractors-- -Placeholder distractor 1 +To play audio and video files --- -Placeholder distractor 2 +To edit existing media files --- -Placeholder distractor 3 +To create visual representations of audio #### --answer-- -Placeholder answer +To record audio and video from a media stream ### --question-- #### --text-- -Placeholder question +Which of the following is NOT a valid state for an `HTMLMediaElement`? #### --distractors-- -Placeholder distractor 1 +`paused` --- -Placeholder distractor 2 +`playing` --- -Placeholder distractor 3 +`ended` #### --answer-- -Placeholder answer +`stopped` ### --question-- #### --text-- -Placeholder question +What does the `preload` attribute do when used with audio or video elements? #### --distractors-- -Placeholder distractor 1 +Automatically starts playing the media --- -Placeholder distractor 2 +Loads the media file before loading the rest of the page --- -Placeholder distractor 3 +Applies a filter to the media #### --answer-- -Placeholder answer +Specifies how much of the media file should be loaded when the page loads ### --question-- #### --text-- -Placeholder question +Which Web Audio API interface is used to represent an audio-processing graph? #### --distractors-- -Placeholder distractor 1 +`AudioNode` --- -Placeholder distractor 2 +`AudioBuffer` --- -Placeholder distractor 3 +`AudioListener` #### --answer-- -Placeholder answer +`AudioContext` ### --question-- #### --text-- -Placeholder question +What is the purpose of the Media Source Extensions API? #### --distractors-- -Placeholder distractor 1 +Add visual effects to video --- -Placeholder distractor 2 +Convert between different media formats --- -Placeholder distractor 3 +Enable JavaScript to synchronize multiple audio tracks #### --answer-- -Placeholder answer +Enable JavaScript to generate media streams for playback ### --question-- #### --text-- -Placeholder question +Which method is used to connect nodes in the Web Audio API? #### --distractors-- -Placeholder distractor 1 +`linkTo()` --- -Placeholder distractor 2 +`attachNode()` --- -Placeholder distractor 3 +`joinAudioPath()` #### --answer-- -Placeholder answer +`connect()` ### --question-- #### --text-- -Placeholder question +What does the following code do? + +```javascript +navigator.mediaDevices.enumerateDevices() + .then(devices => console.log(devices)); +``` #### --distractors-- -Placeholder distractor 1 +Plays all available media devices --- -Placeholder distractor 2 +Stops all active media streams --- -Placeholder distractor 3 +Counts the number of connected displays #### --answer-- -Placeholder answer +Lists all available media input and output devices ### --question-- #### --text-- -Placeholder question +Which property of the `HTMLMediaElement` interface is used to mute or unmute the audio? #### --distractors-- -Placeholder distractor 1 +`silent` --- -Placeholder distractor 2 +`volume` --- -Placeholder distractor 3 +`audioEnabled` #### --answer-- -Placeholder answer +`muted`