Speaker Module

How do you program the speaker module in RobotC ???

Lol here’s another post that I’m responding to.
First, make sure that the speaker is in the “SP” port on the CORTEX in order to play sound.
With programming, there is a variety of ways to program the speaker module.

  1. You can play a tone by

  PlayTone(440, 50);

The first parameter is the amount of Hz of the tone, the second is length to play in 100th of a second (50 = .5 seconds)

  1. You can play a pre-installed sound by

  PlaySound(soundBeepBeep);

There are other types of sounds that are pre-installed. You just gotta do research on it…

  1. You can play a sound file that you want the robot to play. In order to play a sound, you must play the sound as “[name].[type]” An example of playing a file is:

  PlaySoundFile("1.wav");

If you want to get more information of making a sound file the right format to upload to the robot, and how to upload a sound to the robot, it can be found at http://www.robotc.net/wikiarchive/Tutorials/VEX_Speaker_module
NOTE//: You don’t have to add anything to “Motors and Sensors Setup” in order to program it.