Speech | lrf.speech
Little Robot Friends have a single, 1/4 watt, 8ohm speaker; this allows them to create a diverse set of sounds. The user can create custom notes or set the speaker to a particular frequency.
Functions called from within the "speech" portion of the library have the prefix of lrf.speech
setFrequency()
Description
This function sets the frequency of the robot's speaker.
Examples
lrf.speech.setFrequency(2000);
Syntax
setFrequency(frequency)
Parameters
frequency
: unsigned int - the frequency that you wish to emit from the speaker.
Returns
none
Notes
none
quiet()
Description
This function interrupts and silences the speaker if it is currently emitting sound.
Examples
lrf.speech.quiet();
Syntax
quiet()
Parameters
none
Returns
none
Notes
none
saySound()
Description
This function will play a LRFSound type.
Examples
Basic
lrf.speech.saySound(mySound);
Advanced
lrf.speech.saySound(mySound, true);
Syntax
saySound(sound)
saySound(sound, blocking)
Parameters
sound
: LRFSound type - user-defined soundblocking
(optional) : bool - determines whether or not the function is blocking
Returns
none
Notes
none
saySounds()
Description
This function
Examples
Basic
lrf.speech.saySounds(*mySounds, noOfSounds);
Advanced
lrf.speech.saySounds(*mySounds, noOfSounds, true);
Syntax
saySounds(sounds, count)
saySounds(sounds, count, blocking)
Parameters
sounds
: LRFSound* type - A pointer to the user defined sounds.count
: unsigned char - The number of sounds that will be played.blocking
optional : bool - determines whether or not the function is blocking.
Returns
none
Notes
none
isSpeaking()
Description
This function returns a value of true
if the robot's speaker is currently in use.
Examples
if (lrf.speech.isSpeaking() == true) {
lrf.speech.quiet();
}
Syntax
isSpeaking()
Parameters
none
Returns
bool
- True - If speaker is currently emitting sound.
- False - If speaker is not currently emitting sound.
Notes
none