Pepper やNaoで使用されているNaoqi OSのメモです。


NAOqi Audio - 概要 | API | チュートリアル

Namespace : AL
#include <alproxies/altexttospeechproxy.h>

メソッドリスト


どのモジュールでも、このモジュールはALModule APIからメソッドを継承します。

Methods


bool ALTextToSpeechProxy::addToDictionary(const std::string& word, const std::string& pronunciation)

ニュアンスのみ。

現在使用している言語の単語の発音を変更します。新しい発音はロボットに保存されるため、電源を切っても残ります。

引数:
word – 変更した英単語
pronunciation – 英単語の新しい発音
戻り値:
成功 : true、失敗 : false

altexttospeech_userdictionary.py

#! /usr/bin/env python
# -*- encoding: UTF-8 -*-

"""Example: Use Dictionary TTS Methods (English)"""

import qi
import argparse
import sys


def main(session):
    """
    This example uses the Dictionary TTS methods (English).
    It adds and removes words in the dictionary from the module.
    """
    # Get the service ALTextToSpeech.

    tts = session.service("ALTextToSpeech")

    tts.setLanguage("English")
    # Say Emile in english
    tts.say("My name is Emile.")

    # Add Emile to dictionary
    tts.addToDictionary("Emile", "\\toi=lhp\\E'mil\\toi=orth\\")

    # Test it
    tts.say("My name is Emile.")

    # Delete the word Emile
    tts.deleteFromDictionary ("Emile")

    # Re-test it
    tts.say("My name is Emile.")


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", type=str, default="127.0.0.1",
                        help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.")
    parser.add_argument("--port", type=int, default=9559,
                        help="Naoqi port number")

    args = parser.parse_args()
    session = qi.Session()
    try:
        session.connect("tcp://" + args.ip + ":" + str(args.port))
    except RuntimeError:
        print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n"
               "Please check your script arguments. Run with -h option for help.")
        sys.exit(1)
    main(session)


bool ALTextToSpeechProxy::addToDictionary(const std::string& type, const std::string& word, const std::string& priority, const std::string& phonetic, const std::string& accent)

日本語のみ対応。

辞書の特定の単語を型、発音、優先度付きで追加します。新しい発音はロボットに保存されるため、電源を切っても残ります。

引数:
type – 単語の型 (名詞-一般, 名詞-固有名詞-人名-一般, 名詞-固有名詞-人名-姓, 名詞-固有名詞-人名-名, 名詞-固有名詞-地域-一般, 名詞-固有名詞-一般, 名詞-サ変接続, 名詞-形容動詞語幹, 記号-一般)
word – 追加したいひらがな、カタカナ、漢字のいずれかの単語
priority – 1〜9999までの優先順位
phonetic – 発音について。単語のカタカナと同じ
accent – 選ばれたシラバスの強調
戻り値:
成功時 : true、失敗時 : false

altexttospeech_userdictionary.py
#! /usr/bin/env python
# -*- encoding: UTF-8 -*-

"""Example: Use Dictionary TTS Methods (Japanese)"""

import qi
import argparse
import sys


def main(session):
    """
    This example uses the Dictionary TTS methods.
    It adds and removes words in the dictionary from the module.
    """
    # Get the service ALTextToSpeech.

    tts = session.service("ALTextToSpeech")
    try :
        tts.setLanguage("Japanese")
    except RuntimeError:
        print "You need to install Japanese language in order to hear correctly these sentences."
    #Check the pronunciation before changing the dictionary
    tts.say("日本語")

    #Add the word  おはよう
    tts.addToDictionary("名詞-一般","日本語","2000" , "ニホンゴ","3-4:*")

    #Test it
    tts.say("日本語")

    #Delete this word in the dictionary to reset the pronunciation
    tts.deleteFromDictionary ("名詞-一般","日本語")

    #Re-test it
    tts.say("日本語")


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", type=str, default="127.0.0.1",
                        help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.")
    parser.add_argument("--port", type=int, default=9559,
                        help="Naoqi port number")

    args = parser.parse_args()
    session = qi.Session()
    try:
        session.connect("tcp://" + args.ip + ":" + str(args.port))
    except RuntimeError:
        print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n"
               "Please check your script arguments. Run with -h option for help.")
        sys.exit(1)
    main(session)



bool ALTextToSpeechProxy::deleteFromDictionary(const std::string& word)
Nuance only.

ユーザ辞書から単語を削除する。

引数:
word – 削除する単語。UTF-8でエンコードされる。
戻り値:
成功 : true、失敗 : false


bool ALTextToSpeechProxy::deleteFromDictionary(const std::string& type, const std::string& word)
日本語のみ対応。
ユーザの日本語辞書から単語の種類に応じて単語を削除する。

引数:
word – ひらがな、カタカナ、感じで削除する単語
type – 単語の種類(名詞、動詞など)
戻り値:
成功 : true、失敗 : false

std::vector<std::string> ALTextToSpeechProxy::getAvailableLanguages()
Returns the list of the languages currently installed on the system.
システムにインストールされている言語のリストを返す。

戻り値: 言語のリスト
例: [‘French’, ‘Chinese’, ‘English’, ‘Japanese’]

サポートされている言語のサブセット:
ALTextToSpeechProxy::getSupportedLanguages

以下を参照して見てください:

nao Supported languages.
pepper Supported languages.

altexttospeech_getavailablelanguages.py
#! /usr/bin/env python
# -*- encoding: UTF-8 -*-

"""Example: Use getAvalaibleLanguages Method"""

import qi
import argparse
import sys


def main(session):
    """
    This example uses the getAvailableLanguages method.
    It gets the list of languages available in the module.
    """
    # Get the service ALTextToSpeech.

    tts = session.service("ALTextToSpeech")

    #Lists the available languages
    lang = tts.getAvailableLanguages();
    print "Available languages: " + str(lang)


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", type=str, default="127.0.0.1",
                        help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.")
    parser.add_argument("--port", type=int, default=9559,
                        help="Naoqi port number")

    args = parser.parse_args()
    session = qi.Session()
    try:
        session.connect("tcp://" + args.ip + ":" + str(args.port))
    except RuntimeError:
        print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n"
               "Please check your script arguments. Run with -h option for help.")
        sys.exit(1)
    main(session)


std::vector<std::string> ALTextToSpeechProxy::getAvailableVoices()
現在システムにインストールされている音声のリストを返します。各ボイス名は英語で与えられます

戻り値: インストール済み音声リスト

std::string ALTextToSpeechProxy::getLanguage()
現在使用している言語名を返します。

戻り値: 言語名
例: ‘French’

インストールされてる言語の一つの可能性があります:

ALTextToSpeechProxy::getAvailableLanguages

以下を参照して見てください:

nao Supported languages
pepp Supported languages.


float ALTextToSpeechProxy::getParameter(const std::string& parameter)
音声エンジンのパラメータの一つを返します。
使用可能なパラメータは、 "pitchShift"、 "doubleVoice"、 "doubleVoiceLevel"および "doubleVoiceTimeShift"です。
このパラメータについては ALTextToSpeechProxy::setParameter を参照してください。

引数:
parameter – パラメータ名
戻り値:
引数に指定したパラメータの値


std::vector<std::string> ALTextToSpeechProxy::getSupportedLanguages()
サポートしているすべての言語をリストにして返します。

戻り値: 言語のリスト
例: [‘French’, ‘Chinese’, ‘English’, ‘German’, ‘Italian’, ‘Japanese’, ‘Korean’, ‘Portuguese’, ‘Spanish’]

以下を参照してください:

nao Supported languages
pepp Supported languages.

#! /usr/bin/env python
# -*- encoding: UTF-8 -*-

"""Example: Use getSupportedLanguages Method"""

import qi
import argparse
import sys


def main(session):
    """
    This example uses the getSupportedLanguages method.
    It gets the list of supported languages by the module.
    """
    # Get the service ALTextToSpeech.

    tts = session.service("ALTextToSpeech")

    #Lists the supported languages
    lang = tts.getSupportedLanguages();
    print "Supported languages: " + str(lang)


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", type=str, default="127.0.0.1",
                        help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.")
    parser.add_argument("--port", type=int, default=9559,
                        help="Naoqi port number")

    args = parser.parse_args()
    session = qi.Session()
    try:
        session.connect("tcp://" + args.ip + ":" + str(args.port))
    except RuntimeError:
        print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n"
               "Please check your script arguments. Run with -h option for help.")
        sys.exit(1)
    main(session)


std::string ALTextToSpeechProxy::getVoice()
現在使用している音声エンジン名を返します。

戻り値: 使用している音声エンジン名

float ALTextToSpeechProxy::getVolume()
スピーチエンジンによって合成された信号に適用される現在のゲインを返します。デフォルト値は1.0です。

戻り値: 音量 [0 - 1]

void ALTextToSpeechProxy::loadVoicePreference(const std::string& preferencesFileSuffix)
バージョン2.3以降では非推奨になります。ALTextToSpeechProxy::setParameter を使用して設定を変更してください。設定を保存するにはALPreferenceManagerを使います。詳細は、ALPreferenceManagerを参照してください。

環境設定ファイルに格納されているXMLファイルで定義された定義された音声および関連する音声パラメータのセットを読み込みます。XMLファイルの名前は、ALTextToSpeech_Voice_preferencesFileSuffixの形式である必要があります。このように各言語の公式の声が定義されています。詳細についてはチュートリアルを参照してください。

引数:
preferencesFileSuffix – 音声設定ファイルの名前

std::string ALTextToSpeechProxy::locale()
ロボットに現在設定されている言語に関連付けられたロケールを返します。

引数: 現在の言語に関連づけされているロケール
例: ‘en_US’

以下を参照してください:

nao Supported languages
pepp Supported languages.

void ALTextToSpeechProxy::resetSpeed()
音声の速度をパラメータdefaultVoiceSpeedに保存されている値にリセットします。


void ALTextToSpeechProxy::say(const std::string& stringToSay)
ALTextToSpeechProxy::say
ALTextToSpeechProxy::say ←言語設定
指定された文字列を表示します。

使用について:
  1. ALTextToSpeechProxy::setLanguageを使用して一時的に定義された言語
  2. 優先言語、もしくは、
  3. 嫌な言葉

詳細について: nao Setting NAO’s preferred language pepp Setting Pepper’s preferred language.

引数:
stringToSay – UTF-8で指定された発話させたい文字列

altexttospeech_say.py
#! /usr/bin/env python
# -*- encoding: UTF-8 -*-

"""Example: Use say Method"""

import qi
import argparse
import sys


def main(session):
    """
    This example uses the say method.
    It makes the robot say some text using the module.
    """
    # Get the service ALTextToSpeech.
    tts = session.service("ALTextToSpeech")

    #Says a test std::string
    tts.say("This is a sample text!")


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", type=str, default="127.0.0.1",
                        help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.")
    parser.add_argument("--port", type=int, default=9559,
                        help="Naoqi port number")

    args = parser.parse_args()
    session = qi.Session()
    try:
        session.connect("tcp://" + args.ip + ":" + str(args.port))
    except RuntimeError:
        print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n"
               "Please check your script arguments. Run with -h option for help.")
        sys.exit(1)
    main(session)

void ALTextToSpeechProxy::say(const std::string& stringToSay, const std::string& language)
指定された文字列を指定された言語で発話させます。
引数:
stringToSay – UTF-8でエンコードされた発話させたい文字列
language – 使用可能な言語の名前

例: ‘French’

参照して見てください : ALTextToSpeechProxy::getAvailableLanguages.

altexttospeech_altexttospeech_say2.py
#! /usr/bin/env python
# -*- encoding: UTF-8 -*-

"""Example: Use say Method"""

import qi
import argparse
import sys


def main(session):
    """
    This example uses the say method to make the robot speak.
    If French is installed, it will use the French pronunciation for "voiture"
    Else, it will try to say it in English.
    """
    # Get the service ALTextToSpeech.

    tts = session.service("ALTextToSpeech")

    #Sets the language to English
    tts.setLanguage("English")

    tts.say("Let me teach you some French words.")
    tts.say("In French, we say")
    try :
        tts.say("voiture", "French")
    except RuntimeError:
        print "French language is not installed, please install it to have a French pronunciation."
        tts.say("voiture", "English")
    tts.say("for car")


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", type=str, default="127.0.0.1",
                        help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.")
    parser.add_argument("--port", type=int, default=9559,
                        help="Naoqi port number")

    args = parser.parse_args()
    session = qi.Session()
    try:
        session.connect("tcp://" + args.ip + ":" + str(args.port))
    except RuntimeError:
        print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n"
               "Please check your script arguments. Run with -h option for help.")
        sys.exit(1)
    main(session)


void ALTextToSpeechProxy::sayToFile(const std::string& stringToSay, const std::string& fileName)
ALTextToSpeechProxy::say と同様に動作しますが、合成信号はロボットのスピーカーに送信されるのではなく、指定されたファイルに記録されます。信号は、22050Hz(欧州言語)および16000Hz(アジア言語)の標本レート、S16_LE、1チャネルでエンコードされます。

引数:
stringToSay – UTF-8でエンコードされた音声合成される文字列
fileName – 合成された信号を保存するファイル(.rawファイルまたは.wavファイルのいずれかのみ)

altexttospeech_saytofile.py
#! /usr/bin/env python
# -*- encoding: UTF-8 -*-

"""Example: Use sayToFile Method"""

import qi
import argparse
import sys


def main(session):
    """
    This example uses the sayToFile method.
    It makes the robot say some text using the module,
    And write it in a file.
    """
    # Get the service ALTextToSpeech.

    tts = session.service("ALTextToSpeech")

    #Says a test std::string, and save it into a file
    tts.sayToFile("This is a sample text, written in a file!", "/tmp/sample_text.raw")

    #Says a test std::string, and save it into a file
    tts.sayToFile("This is another sample text", "/tmp/sample_text.wav")


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", type=str, default="127.0.0.1",
                        help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.")
    parser.add_argument("--port", type=int, default=9559,
                        help="Naoqi port number")

    args = parser.parse_args()
    session = qi.Session()
    try:
        session.connect("tcp://" + args.ip + ":" + str(args.port))
    except RuntimeError:
        print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n"
               "Please check your script arguments. Run with -h option for help.")
        sys.exit(1)
    main(session)

void ALTextToSpeechProxy::setLanguage(const std::string& language)
現在のアプリケーションで使用する言語を音声システムに設定します。

この設定はアプリケーションの終了後に優先言語に戻ります。

※ 2017年1月15日に検証して見たところ、アプリケーションが終了しても言語は元に戻りませんでした。(English→JapaneseとJapanese→Englishを試しました.)

詳細についてはこちらを参照してください:
nao Setting NAO’s preferred language
pepp Setting Pepper’s preferred language.

引数:
language – 使用可能な言語の名前

例: ‘French’

こちらも御覧ください: ALSpeechRecognitionProxy::getAvailableLanguages.

void ALTextToSpeechProxy::setLanguageDefaultVoice(const std::string& language, const std::string& voice)
デフォルトで使用される言語と音声エンジンを設定します。

引数:
language – ロボットで利用可能な言語

併せて御覧ください: ALSpeechRecognitionProxy::getAvailableLanguages.

voice – ロボット上でこの言語を利用可能な音声エンジン


void ALTextToSpeechProxy::setParameter(const std::string& parameter, const float& value)
テキストのパラメータを音声エンジンに設定します。

引数:
parameter – パラメータの名前
value – パラメータの値

音声エンジン固有の使用可能パラメータ:

— すべての言語 —
パラメータ説明
pitchShift音声にピッチ・シフトを適用します。値は新しい基本周波数と元の周波数の比を示します(例:2.0:上のオクターブ、1.5:上の5倍)。許容範囲は[1.0 - 4]です。 0はエフェクトを無効にします。
doubleVoice第1の音声に第2の音声を加えます。この値は、第2の音声基本周波数と第1の音声基本周波数との間の比を示します。許容範囲は[1.0〜4]です。 0はエフェクトを無効にします。
doubleVoiceLevel追加音声のゲインを元のものと比較して設定します。許容範囲は[0 - 4]です。 0はエフェクトを無効にします。
doubleVoiceTimeShift2倍の音声と元の音の間の遅延(秒)を設定します。許容範囲は[0 - 0.5]です。
speed現在の音声速度を設定します。デフォルト値は100です。許容範囲は[50〜400]です。
defaultVoiceSpeed音声のデフォルト速度を設定します。速度はALTextToSpeechProxy::resetSpeedが呼び出されたときにこの値に設定されます。このパラメータを設定すると速度もリセットされます。許容範囲は[50〜400]です。

— 日本語のみ —
パラメータ説明
enableCompressionスピーチでオーディオのダイナミック圧縮を有効にします。これにより、音声の全体的な音量が増加します。
0 オーディオの動的圧縮を有効にする1は、オーディオの動的圧縮を無効にする。
パラメータ許容範囲
volume[0.00001 - 2.0]
pitch[0.5 - 2.0]
emph[0.0 - 2.0]
pauseMiddle[80.0 and 300.0]
pauseLong[300.0 - 2000.0]
pauseSentence[80.0 and 10000.0]

altexttospeech_setparameter.py
#! /usr/bin/env python
# -*- encoding: UTF-8 -*-

"""Example: Use setParameter Method"""

import qi
import argparse
import sys


def main(session):
    """
    This example uses the setParameter method.
    It sets the pitchShift to use in the module.
    """
    # Get the service ALTextToSpeech.

    tts = session.service("ALTextToSpeech")

    #Applies a pitch shifting to the voice
    tts.setParameter("pitchShift", 1.5)
    #Deactivates double voice
    tts.setParameter("doubleVoice", 0.0)

    tts.say("Pitch shift and double voice changed")


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", type=str, default="127.0.0.1",
                        help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.")
    parser.add_argument("--port", type=int, default=9559,
                        help="Naoqi port number")

    args = parser.parse_args()
    session = qi.Session()
    try:
        session.connect("tcp://" + args.ip + ":" + str(args.port))
    except RuntimeError:
        print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n"
               "Please check your script arguments. Run with -h option for help.")
        sys.exit(1)
    main(session)

void ALTextToSpeechProxy::setVoice(const std::string& voiceID)
テキスト読み上げエンジンによって使用される音声を変更します。音声識別子(voiceID)は、インストールされた音声を指定する必要があります。[[ALTextToSpeechProxy::getAvailableVoices]>#getAvailableVoices]メソッドを使用してリストすることができます。

引数:
voiceID – 音声識別子

altexttospeech_setvoice.py
#! /usr/bin/env python
# -*- encoding: UTF-8 -*-

"""Example: Use setVoice Method"""

import qi
import argparse
import sys


def main(session):
    """
    This example uses the setVoice method.
    It sets the voice to use in the module.
    """
    # Get the service ALTextToSpeech.

    tts = session.service("ALTextToSpeech")

    #Changes the basic voice of the synthesis
    tts.setVoice("naoenu")

    tts.say("Voice changed to naoenu")


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", type=str, default="127.0.0.1",
                        help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.")
    parser.add_argument("--port", type=int, default=9559,
                        help="Naoqi port number")

    args = parser.parse_args()
    session = qi.Session()
    try:
        session.connect("tcp://" + args.ip + ":" + str(args.port))
    except RuntimeError:
        print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n"
               "Please check your script arguments. Run with -h option for help.")
        sys.exit(1)
    main(session)


void ALTextToSpeechProxy::setVolume(const float& volume)
音声合成エンジンによって合成された音声信号の音量を変更します。デフォルト値は1.0です。

引数:
volume – ゲイン(利得)

altexttospeech_setvolume.py
#! /usr/bin/env python
# -*- encoding: UTF-8 -*-

"""Example: Use setVolume Method"""

import qi
import argparse
import sys


def main(session):
    """
    This example uses the setVolume method.
    It sets the volume to use in the module.
    """
    # Get the service ALTextToSpeech.

    tts = session.service("ALTextToSpeech")

    #Changes the volume
    tts.setVolume(0.5)
    tts.say("Volume set to 50%")


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", type=str, default="127.0.0.1",
                        help="Robot IP address. On robot or Local Naoqi: use '127.0.0.1'.")
    parser.add_argument("--port", type=int, default=9559,
                        help="Naoqi port number")

    args = parser.parse_args()
    session = qi.Session()
    try:
        session.connect("tcp://" + args.ip + ":" + str(args.port))
    except RuntimeError:
        print ("Can't connect to Naoqi at ip \"" + args.ip + "\" on port " + str(args.port) +".\n"
               "Please check your script arguments. Run with -h option for help.")
        sys.exit(1)
    main(session)


void ALTextToSpeechProxy::showDictionary()
ニュアンスと日本語のみ。


naoqiのログに現在の言語のユーザー辞書がある場合は、その辞書を表示します。

void ALTextToSpeechProxy::stopAll()
現在のタスクと保留中のタスクをすべて終了します。


Events


Event: "ALTextToSpeech/CurrentBookMark"
callback(std::string eventName, int value, std::string subscriberIdentifier)
合成する必要のある文字列内に配置されているブックマークの出現を示します( "mrk = number"の数字は整数[0 - 65535]です)。

詳細については、以下を参照してください:Acapela Mobility Text TAGS(外部PDFページ)

引数:
eventName (std::string) – “ALTextToSpeech/CurrentBookMark”
value – 現在のブックマーク.
subscriberIdentifier (std::string) –


Event: "ALTextToSpeech/CurrentSentence"
callback(std::string eventName, std::string value, std::string subscriberIdentifier)
現在合成されている文章を示します。

引数:
eventName (std::string) – “ALTextToSpeech/CurrentSentence”
value – 現在の文章
subscriberIdentifier (std::string) –

Event: "ALTextToSpeech/CurrentWord"
callback(std::string eventName, std::string value, std::string subscriberIdentifier)
現在合成されている単語を示します。

Warning
日本語では使用できません。

Parameters:
eventName (std::string) – “ALTextToSpeech/CurrentWord”
value – 現在の単語
subscriberIdentifier (std::string) –

Event: "ALTextToSpeech/PositionOfCurrentWord"
callback(std::string eventName, int value, std::string subscriberIdentifier)
現在の文章の索引によって現在合成されている単語を示します。索引0は、文の最初の単語を指します。

Warning
日本語では使用できません。

引数:
eventName (std::string) – “ALTextToSpeech/PositionOfCurrentWord”
value – 現在の単語の位置。
subscriberIdentifier (std::string) –



Event: "ALTextToSpeech/Status"
callback(std::string eventName, AL::ALValue value, std::string subscriberIdentifier)
タスクの状態が変化したときに発火します。

引数:
eventName (std::string) – “ALTextToSpeech/Status”
value – [idOfConcernedTask, status]

Where:

idOfConcernedTask は、イベントが関係するタスクのIDです。
ステータスは、"enqueued"、"started"、"thrown"、"stopped" or "done"のいずれかです。
subscriberIdentifier (std::string) –


Event: "ALTextToSpeech/TextStarted"
callback(std::string eventName, bool value, std::string subscriberIdentifier)
現在の文章の合成が始まると発火します。

引数:
eventName (std::string) – “ALTextToSpeech/TextStarted”
value – 発話タスクが実行中の時はtrueです。
subscriberIdentifier (std::string) –

Event: "ALTextToSpeech/TextDone"
callback(std::string eventName, bool value, std::string subscriberIdentifier)
現在の文章の合成が終了した時に発火します。

引数:
eventName (std::string) – “ALTextToSpeech/TextDone”
value – 現在の発話タスクが完了している場合にはtrueです。
subscriberIdentifier (std::string) –

Event: "ALTextToSpeech/TextInterrupted"
callback(std::string eventName, bool value, std::string subscriberIdentifier)
ALTextToSpeechProxy::stopAllなど、現在の文の合成が中断されたときに発火します。

引数:
eventName (std::string) – "ALTextToSpeech/TextInterrupted"
value – 現在の発話タスクが中断されている場合にはtrueです。
subscriberIdentifier (std::string) –



Signals


qi::Signal<qi::os::timeval> ALTextToSpeech::synchroTTS
対話セッション中、ロボットはスピーチフェーズとリスニングフェーズの間で切り替わります。この信号は、リスニングフェーズの開始を示すために、スピーチフェーズの最後のセンテンスにのみ発生します。時間値には、実際の終了前に再生される残りの音が含まれます。


qi::Signal<std::string> ALTextToSpeech::languageTTS
音声認識エンジンによって使用される言語が正常に変更されるたびに発生します。文字列には、言語セットに対応するロケールコードが含まれます。

このコードとその言語との対応を確認するには、naoのサポート言語peppサポートされている言語を参照してください。

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Menu

NAOqi - Developer guide

Creating an application?

Programming for a living robot?

Other tutorials?

Choregraphe Suite?

どなたでも編集できます