Step 13: Coding the Speed Slider

Goal:


Now let’s program what will happen when we move the SpeedSlider.

This code will change the speed of the TextToSpeech voice every time that the slider is moved.

Steps:

  1. Under the section labeled Blocks select SpeedSlider.
  2. Grab and place the block labeled “when SpeedSlider.PositionChanged”.
  3. Under Blocks select TextToSpeech1.
  4. Grab and place the block labeled “set TextToSpeech1.Country”.
  5. Change “Country” to say “SpeechRate”.
  6. On the “when SpeedSlider.PositionChanged” block, hover your mouse over “thumbPosition”.
  7. Then grab the “get thumbPosition” block and place it inside the “set TextToSpeech1.SpeechRate” block.

Code:


Click to replay