Last Update:2004/11/04

Modify history
------Changes from the Beta1
* Modified the API of the Speak() function. The sound comes from AIBO.
* VAIBOTTS.h  Added Error code
   // Speak
   E_VAIBOTTS_ERROR_OVER_STRING, 
   E_VAIBOTTS_ERROR_NOT_CONNECTED,
   E_VAIBOTTS_ERROR_BUSY_NETAUDIO,
   E_VAIBOTTS_ERROR_NOT_START_NETAUDIO,
   E_VAIBOTTS_ERROR_NOT_MAKEWAVEFILE,
   E_VAIBOTTS_ERROR_NOT_SENDWAVEFILE,


// Error code list
enum {
    E_VAIBOTTS_NOERROR,
    // All 
    E_VAIBOTTS_ERROR,                                     // Error
    E_VAIBOTTS_ERROR_NOT_START,                           // TTS engine is not initialized
    E_VAIBOTTS_ERROR_ILLEGAL_LEXICON,                     // Illegal lexicon
    // SonyTTS 
    E_VAIBOTTS_ERROR_SONYTTS_INIT,                        // Initialization of the Sony TTS engine failed
    E_VAIBOTTS_ERROR_SONYTTS_NOT_START,                   // Sony TTS engine is not initialized
    E_VAIBOTTS_ERROR_SONYTTS_OPENFILE,                    // Sony TTS Wave file open error
    E_VAIBOTTS_ERROR_SONYTTS_CONVERTER,                   // Sony TTS Wave data conversion error
    E_VAIBOTTS_ERROR_SONYTTS_BUFFER_SIZE_OVER,            // Sony TTS buffer overflow
    E_VAIBOTTS_ERROR_SONYTTS_ACM_FORMAT_COMVERTER,        // Sony TTS Wave data(ACM format) conversion error
    E_VAIBOTTS_ERROR_SONYTTS_LEXICON_INIT,                // Sony TTS lexicon open error
    E_VAIBOTTS_ERROR_SONYTTS_LEXICON_ILLEGAL_WORDNO,      // Sony TTS lexicon illegal word index
    E_VAIBOTTS_ERROR_SONYTTS_LEXICON_ILLEGAL_WORD,        // Sony TTS lexicon illegal word
    E_VAIBOTTS_ERROR_SONYTTS_LEXICON_ILLEGAL_PHONE,       // Sony TTS lexicon illegal word phone
    E_VAIBOTTS_ERROR_SONYTTS_LEXICON_ILLEGAL_PART,        // Sony TTS lexicon illegal word part
    E_VAIBOTTS_ERROR_SONYTTS_LEXICON_ENTRY_API,           // Sony TTS lexicon entry API error
    // SAPI 
    E_VAIBOTTS_ERROR_SAPI_INIT,                           // Initialization of the SAPI engine failed
    E_VAIBOTTS_ERROR_SAPI_NOT_START,                      // SAPI engine is not initialized
    E_VAIBOTTS_ERROR_SAPI_OUTPUTSTREAM,                   // SAPI output stream voice error
    E_VAIBOTTS_ERROR_SAPI_LEXICON_INIT,                   // SAPI lexicon open error
    E_VAIBOTTS_ERROR_SAPI_LEXICON_NOT_START,              // SAPI lexicon is not initialized
    E_VAIBOTTS_ERROR_SAPI_LEXICON_ILLEGAL_WORDNO,         // SAPI lexicon illegal word index
    E_VAIBOTTS_ERROR_SAPI_LEXICON_ILLEGAL_LANGUAGE,       // SAPI lexicon illegal language
    E_VAIBOTTS_ERROR_SAPI_LEXICON_ILLEGAL_PART,           // SAPI lexicon illegal word part 
    E_VAIBOTTS_ERROR_SAPI_LEXICON_CONVERTER,              // SAPI lexicon converter error
    // Speak
    E_VAIBOTTS_ERROR_OVER_STRING,                         // String is too long
    E_VAIBOTTS_ERROR_NOT_CONNECTED,                       // Cannot connect to AIBO
    E_VAIBOTTS_ERROR_BUSY_NETAUDIO,                       // NETAUDIO Busy
    E_VAIBOTTS_ERROR_NOT_START_NETAUDIO,                  // NETAUDIO isn't started
    E_VAIBOTTS_ERROR_NOT_MAKEWAVEFILE,                    // Cannot make WAVE file
    E_VAIBOTTS_ERROR_NOT_SENDWAVEFILE,                    // Cannot send WAVE file to AIBO

    MAX_E_VAIBOTTS_ERROR
};


+ Init
[Function] Initialize library
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Initialize library
[Usage] 
int     CVAIBOTTS::Init()

+ End
[Function] End library
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] End library
[Usage] 
int     CVAIBOTTS::End()


+ GetTTSEngineNum
[Function] Get number of TTS engines
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Get number of TTS engines
[Usage] 
int     CVAIBOTTS::GetTTSEngineNum(
                            int& nListNum )         // Number of TTS engines  (store)

+ GetTTSEngineName
[Function] Get name of TTS engines
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Get name of TTS engines
[Usage] 
int     CVAIBOTTS::GetTTSEngineName(
                            int nIdx,               // index of TTS engine
                            char* strEngineName )   // Name of TTS engine (store)

+ GetTTSEngineKind
[Function] Get kind of TTS engine
[Return] Kind of TTS engine (E_VAIBOTTS_ENGINE_SONYTTS,E_VAIBOTTS_ENGINE_SAPI..)
[Description] Get kind of TTS engine
[Usage] 
E_VAIBOTTS_ENGINE   CVAIBOTTS::GetTTSEngineKind(
                            int nIdx )              // index of TTS engine


+ GetVoiceEngine
[Function] Get current TTS engine
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Get current TTS engine
[Usage] 
int     CVAIBOTTS::GetVoiceEngine(
                            int* pIdx )             // index of current TTS engine (store)


+ SetVoiceEngine
[Function] Set current TTS engine
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Set current TTS engine
[Usage] 
int     CVAIBOTTS::SetVoiceEngine(
                            int nIdx )              // index of TTS engine 


+ Speak
[Function] Convert string(text) to voice and play it (speak)
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Convert string(text) to voice and play it (speak)
    Specify AIBO with m_vaibo. If it is NULL, the sound will comes from the PC speaker.
[Usage] 
int     CVAIBOTTS::Speak(
                            CVAIBO *m_vaibo,        // AIBO that will speak
                            const char* strText )   // string 


+ MakeWaveFile
[Function] Convert string(text) to WAVE file
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Convert string(text) to WAVE file.
[Usage] 
int     CVAIBOTTS::MakeWaveFile(
                            const char* strText,      // Input string
                            const char* strFileName ) // Output wave file

+ MakePcmData
[Function] Convert string(text) to PCM data
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description]  Convert string(text) to PCM data
[Usage] 
int     CVAIBOTTS::MakePcmData(
                            const char* strText,       // Input string
                            char* pPcmData,            // Output buffer
                            int* pPcmDataSize,         // Output data size
                            int nMaxSize )             // Buffer size


+ SetVoiceSpeed
[Function] Set voice speed
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Set voice speed
[Usage] 
int     CVAIBOTTS::SetVoiceSpeed(
                            unsigned int unSpeed )     // Speed (0 --- VOICE_PARAM_MAX(100))

+ SetVoicePitch
[Function] Set voice pitch
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Set voice pitch
        This function doesn't work with SAPI engine
[Usage] 
int     CVAIBOTTS::SetVoicePitch(
                            unsigned int unPitch )     // Pitch (0 --- VOICE_PARAM_MAX(100))

+ SetVoiceAccent
[Function] Set voice accent
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description]  Set voice accent
        This function doesn't work with SAPI engine
[Usage] 
int     CVAIBOTTS::SetVoiceAccent(
                            unsigned int unAccent )     // Accent (0 --- VOICE_PARAM_MAX(100))

+ SetVoiceVolume
[Function] Set voice volume
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Set voice volume
[Usage] 
int     CVAIBOTTS::SetVoiceVolume(
                            unsigned int unVolume )     // Volume (0 --- VOICE_PARAM_MAX(100))

+ SetOutputFormat
[Function] Set output PCM data format
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description]  Set output PCM data format
[Usage] 
int     CVAIBOTTS::SetOutputFormat(
                            int nWaveFormat )           // PCM data format (E_TTS_WAVE_FORMAT_16K_16BIT,E_TTS_WAVE_FORMAT_8K_8BIT..)


+ GetVoiceSpeed
[Function] Get voice speed
[Return] Speed (0 --- VOICE_PARAM_MAX(100))
[Description] Get voice speed
[Usage] 
unsigned int    CVAIBOTTS::GetVoiceSpeed()

+ GetVoicePitch
[Function] Get voice pitch
[Return] Pitch (0 --- VOICE_PARAM_MAX(100))
[Description] Get voice pitch
[Usage] 
unsigned int    CVAIBOTTS::GetVoicePitch()

+ GetVoiceAccent
[Function] Get voice accent
[Return] Accent (0 --- VOICE_PARAM_MAX(100))
[Description] Get voice accent
[Usage] 
unsigned int    CVAIBOTTS::GetVoiceAccent()

+ GetVoiceVolume
[Function] Get voice volume
[Return] Volume (0 --- VOICE_PARAM_MAX(100))
[Description] Get voice volume
[Usage] 
unsigned int    CVAIBOTTS::GetVoiceVolume()

+ GetOutputFormat
[Function] Get output PCM data format
[Return] PCM data format (E_TTS_WAVE_FORMAT_16K_16BIT,E_TTS_WAVE_FORMAT_8K_8BIT..)
[Description] Get output PCM data format
[Usage] 
int         CVAIBOTTS::GetOutputFormat()


+ GetWordNumInLexicon
[Function] Get number of words in the lexicon
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] number of words
[Usage] 
int     CVAIBOTTS::GetWordNumInLexicon(
                                E_VAIBOTTS_LEXICON eLexicon,    // Lexicon(E_VAIBOTTS_LEXICON_SONYTTS_J,E_VAIBOTTS_LEXICON_SAPI_E..) 
                                int& nWord )                    // number of words (store) 

+ GetWordInLexicon
[Function] Get word in the lexicon
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Get word in the lexicon
[Usage] 
int     CVAIBOTTS::GetWordInLexicon(
                                E_VAIBOTTS_LEXICON eLexicon,    // Lexicon(E_VAIBOTTS_LEXICON_SONYTTS_J,E_VAIBOTTS_LEXICON_SAPI_E..)
                                int nIdx,                       // index of the word
                                char* strWord )                 // word (store)


+ GetPronunciationInLexicon
[Function] Get pronunciation of the word in the lexicon
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Get pronunciation of the word in the lexicon
        If the lexicon is Japanese, Kana will be retrieved.
        If the lexicon is English, a phonetic symbol will be retrieved.
[Usage] 
int     CVAIBOTTS::GetPronunciationInLexicon(
                                E_VAIBOTTS_LEXICON eLexicon,    // Lexicon(E_VAIBOTTS_LEXICON_SONYTTS_J,E_VAIBOTTS_LEXICON_SAPI_E..)
                                int nIdx,                       // index of the word
                                char* strPronunciation )        // phonetic symbol (store)

+ GetPartInLexicon
[Function] Get part of the word
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Get part of the word
[Usage] 
int     CVAIBOTTS::GetPartInLexicon(
                                E_VAIBOTTS_LEXICON eLexicon,    // Lexicon(E_VAIBOTTS_LEXICON_SONYTTS_J,E_VAIBOTTS_LEXICON_SAPI_E..)
                                int nIdx,                       // index of the word
                                char* strPart )                 // part (store) 

+ AddWordInLexicon
[Function] Add word in the lexicon
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Add word in the lexicon
        The part is different between the Sony TTS and SAPI.
[Usage] 
int     CVAIBOTTS::AddWordInLexicon(
                                E_VAIBOTTS_LEXICON eLexicon,    // Lexicon (E_VAIBOTTS_LEXICON_SONYTTS_J,E_VAIBOTTS_LEXICON_SAPI_E..)
                                char* strWord,                  // word
                                char* strPhone,                 // phonetic symbol 
                                E_VAIBOTTS_PART ePart )         // Part(E_VAIBOTTS_PART_SAPI_NOUN,E_VAIBOTTS_PART_SONYTTS_FUTUU_NOUN)

+ DeleteWordInLexicon
[Function] Delete word in the lexicon
[Return] Success : VAIBOTTS_NOERROR  Fail : Error code (see Error code list at the top of this text)
[Description] Delete word in the lexicon
[Usage] 
int     CVAIBOTTS::DeleteWordInLexicon(
                                E_VAIBOTTS_LEXICON eLexicon,    // Lexicon(E_VAIBOTTS_LEXICON_SONYTTS_J,E_VAIBOTTS_LEXICON_SAPI_E..)
                                int nIdx )                      // index of the word

