osVoiceCountSyllables osVoiceCountSyllables (function)

Counts the number of semi-syllables in a word

Syntax

#include <ultra64.h> /* ultra64.h */

void osVoiceCountSyllables(u8 *word, s32 *syllables);

Description

The osVoiceCountSyllables function is for calculating how many syllables there are when registering a specific word in the Voice Recognition System. By using this function, you can later determine how many words can be registered in the dictionary. It is convenient to use the function during debugging or when asking the game player to input registered words.

"word" specifies the word (SJIS) to registered. The number of semisyllables resulting from the calculation is returned to *syllables.

The total number of semisyllables which can be registered in the Voice Recognition System dictionary is 880 (440 syllables). If more than this are registered with the osVoiceSetWord function, a CONT_ERR_VOICE_MEMORY error will occur.

Reference

The number of semisyllables is calculated as follows. One semisyllable per word must be added as an offset value.

Type of Syllable Number of Semisyllables Conditions
Vowel only 2 Start of word
Vowel only 1 Anywhere but start of word
Consonant + vowel 2 Start of word, or anywhere but when start of word is Romanized by k, t, c, or p
Consonant + vowel 3 Anywhere but start of word, anywhere except when preceding character is a small "tsu," or when start of word is Romanized by k, t, c, or p
Consonant + diphthong 2 Small "ya" and the like. Start of word or when start of word is Romanized by k, t, c, or p
Consonant + diphthong 3 Small "ya" and the like. Anywhere but start of word, anywhere except when preceding character is a small "tsu," or when start of word is Romanized by k, t, c, or p
"n" 1 none
Long "-" 1 none
Assimilated sound - small "tsu" 1 none

See also

osVoiceClearDictionary, osVoiceControlGain, osVoiceGetReadData, osVoiceInit, osVoiceMaskDictionary, osVoiceSetWord, osVoiceStartReadData, and osVoiceStopReadData

Revision History

1999/04/30 Changed Format