RCodePlus Sound features |
This page describes the sound related extensions provided in RCodePlus.
Voice Command Vocabularies
There are two different voice command vocabularies you can choose between:AP_Vocab, AP_VLang
To check for the current vocabulary in your own RCode Plus program, VLOAD and then check the variable "AP_Vocab". It will be 1 to indicate the LIFE vocabulary. The current language is also stored in "AP_VLang" (2=J, 3=E, 4=G, 5=F).AU_ or AP_
There are two sets of variables for voice and sound detection. The AiboPet RCodePlus extensions start with "AP_". The Sony provided ones start with "AU_" (in RCODE 1.2 and later).For new programs, you should use the "AU_" voice and sound detection features provided in Master Studio 1.1. You can use the "AP_" variables for backward compatibility with old programs or if you need features not supported by the "AU_" variables.
The "AP_" variables are similar but not identical to the "AU_" variables.
AP_ Voice variables
There are several input variables used for detecting voice commands that can be used together.- AP_Voice_Cmd - the last voice command heard (or zero)
- AP_Voice_Level - the volume level (of the last voice command heard)
- AP_Voice_Pitch - the pitch (of the last voice command heard)
- AP_Voice_Horz - the horizontal position (of the last voice command heard)
AP_Voice_Cmd
To wait for a voice command, clear the "AP_Voice_Cmd" variable then wait for it to be non-zero. When it becomes non-zero, the value is the "Vcmd#" documented in the voice command list.When AIBO hears the next voice command, these variables will change, so if you wish to use them later, be sure to take them out of the "AP_Voice_*" variables and put them in your own user variables for later use.
NOTE: same as the "AU_Voice_ID" variable.
AP_Voice_Level
The value is from 1 to 5 representing the volume of the voice heard:AP_Voice_Pitch
The value is from 1 to 5 representing the pitch (frequency) of the voice heard:AP_Voice_Horz
The value is a bit value from 1 to 128 representing the horizontal location where the voice came from (relative to the dog's nose):2 = front right
4 = right
8 = rear right
16 = rear (ie. behind his head)
32 = rear left
64 = left
128 = front left
AP_ Loud variables
There are several variables that detect loud sounds that can be used together.- AP_Loud - non-zero if a loud sound heard
- AP_Loud_Level - the volume level (of the last sound heard)
- AP_Loud_Pitch - the pitch (of the last sound heard)
- AP_Loud_Horz - the horizontal position (of the last sound heard)
The interpretation of the "Level", "Pitch" and "Horz" values is the same as the similar "AP_Voice_*" values. NOTE: the value of "AP_Load" will be set to non-zero when a loud sound is heard. Be sure to clear the variable like you would "AP_Voice_Cmd".
AP_AiboSound, AP_Tone
These two input variables detect musical tones (AiboSound) or ERS-111 Sound controller tri-tones (AP_Tone).NOTE: "AP_AiboSound" is the same as the "AU_AiboSound_ID" variable. The interpretation of the numbers is the same as the RCODE 1.2 values.
NOTE: "AP_Tone" is the same as the "AU_AiboTone_ID" variable. The interpretation of the numbers is the same as the old version. In future will have "_Horz" values that give the position of where the sound/tone came from (version 2.52 and later).
AP_Rhythm, AP_Noise
These last two sound related input variables detect special cases.These input variables work independently, and should be used like "AP_Voice_Cmd". Set the variable to zero, and wait for it to be non-zero.
AP_Rhythm
When non-zero, this indicates a "rhythm" is heard by AIBO, usually a loud song with a strong beat. When non-zero, the value is a fixed pitch of 3. In future will have a "AP_Rhythm_Horz" value can be used to determine where the sound came from (version 2.52 and later).AP_Noise
When non-zero, this indicates a AIBO is hearing a lot of noise. When non-zero, the value is the volume (level) of the noise (in range 1 to 5). There is no position information.Voice Command Dictionary Index
AP_Voice_DicID
This is a special purpose input variable that acts like the "AP_Voice_Cmd" variable. It can be used in conjunction with "AP_Voice_Cmd" or separately. Instead of giving one of 52 high level voice commands, this value is one of several hundred lower level phrases.If you need to use this feature, please email me.