Public Member Functions | |
| def | __init__ |
| def | init |
| def | play_sound |
| def | recognize |
| def | register_sr_response |
| def | register_ss_response |
| def | say |
| def | set_spi_config |
| def | tts |
Private Member Functions | |
| def | _play_package_sound |
| def | _publish_ss_state |
| def | _spi_response_callback |
| def | _sr_response_callback |
| def | _ss_response_callback |
Private Attributes | |
| _pub_sr | |
| _pub_ss | |
| _pub_ss_state | |
| _spi_enable | |
| _spi_engine | |
| _spi_language | |
| _sr_enable | |
| _sr_queue_disp | |
| _sr_queue_num | |
| _sr_req_id | |
| _sr_response | |
| _ss_enable | |
| _ss_req_id | |
| _ss_response | |
Static Private Attributes | |
| string | _ACCEPT_MESSAGE_WAV_FILENAME = 'accept.wav' |
| string | _NO_MESSAGE_WAV_FILENAME = 'nomessage.wav' |
| string | _SPI_RESPONSE_TOPIC_NAME = 'spi_res' |
| string | _SPI_STATE_TOPIC_NAME = 'ss_state' |
| string | _SR_REQUEST_TOPIC_NAME = 'sr_req' |
| string | _SR_RESPONSE_TOPIC_NAME = 'sr_res' |
| string | _SS_REQUEST_TOPIC_NAME = 'ss_req' |
| string | _SS_RESPONSE_TOPIC_NAME = 'ss_res' |
class:
ROSpeexInterface class
brief:
Provides rospeex interface for python.
Definition at line 24 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface.__init__ | ( | self | ) |
Definition at line 40 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface._play_package_sound | ( | self, | |
| file_name | |||
| ) | [private] |
brief:
playing audio file.
param[in]:
file_name: sound file name (file location: rospeex/sound)
Definition at line 133 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface._publish_ss_state | ( | self, | |
| state | |||
| ) | [private] |
brief:
send ss state to spi node.
param[in]:
state: ss state flag.
Definition at line 114 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface._spi_response_callback | ( | self, | |
| response | |||
| ) | [private] |
brief:
Response from signal processing interface (wave monitor).
param[in]:
response: response from ros node
Definition at line 146 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface._sr_response_callback | ( | self, | |
| response | |||
| ) | [private] |
brief:
Response from speech recognition node.
param[in]:
response: speech recognition result surface string
Definition at line 196 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface._ss_response_callback | ( | self, | |
| response | |||
| ) | [private] |
brief:
Response from speech synthesis node.
param[in]:
response: speech synthesis result audio file (wave)
Definition at line 173 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface.init | ( | self, | |
ss = True, |
|||
sr = True, |
|||
spi = True |
|||
| ) |
brief:
Initializing rospeex.
param[in]:
ss: set true to enable speech synthesis
sr: set true to enable speech recognition
spi: set true to enable signal processing interface (waveform monitor)
Definition at line 62 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface.play_sound | ( | self, | |
| sound_path | |||
| ) |
brief:
playing audio file.
param[in]:
sound_path: sound file path
Definition at line 95 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface.recognize | ( | self, | |
| data, | |||
language = 'ja', |
|||
engine = 'nict' |
|||
| ) |
brief:
Recognizing voice data.
param[in]:
data: voice file (wave format: 16kHz, 16bit, mono, LE)
language: language setting (ja, en, zh, ko)
engine: speech recognition engine setting (nict or google)
nict: supports ja, en, zh, ko
google: supports ja, en
Definition at line 341 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface.register_sr_response | ( | self, | |
| func | |||
| ) |
brief:
Registering a speech recognition callback function.
param[in]:
func: form: func(message)
message: speech recognition result surface string
Definition at line 219 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface.register_ss_response | ( | self, | |
| func | |||
| ) |
brief:
Registering a speech synthesis callback function.
param[in]:
func: form: func(data)
data: speech synthesis result audio file (wave)
Definition at line 184 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface.say | ( | self, | |
| message, | |||
language = 'ja', |
|||
engine = 'nict', |
|||
voice_font = '*' |
|||
| ) |
brief:
Performs speech synthesis, and outputs to the speaker.
param[in]:
message: text for performing speech synthesis
language: language setting (ja, en, zh, ko)
engine: speech synthesis engine setting (nict or google or voicetext)
nict: supports ja, en, zh, ko
google: supports ja, en
voicetext: supports ja
voice_font: voice font setting
nict(ja): F128 or F117
nict(en): EF007
nict(zh): CJF101
nict(ko): KF001
google(ja/en): None
voicetext(ja): show, haruka, hikari, takeru, santa, bear
Definition at line 248 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface.set_spi_config | ( | self, | |
language = 'ja', |
|||
engine = 'nict' |
|||
| ) |
brief:
Setting signal processing interface (wave monitor) parameters.
param[in]:
language: language setting (ja, en, zh, ko)
engine: speech recognition engine setting (nict or google)
nict: supports ja, en, zh, ko
google: supports ja, en
Definition at line 231 of file interface.py.
| def rospeex_if.interface.ROSpeexInterface.tts | ( | self, | |
| message, | |||
| file_name, | |||
language = 'ja', |
|||
engine = 'nict', |
|||
voice_font = '*' |
|||
| ) |
brief:
Performs speech synthesis, and outputs to the wave file.
param[in]:
message: text to perform speech synthesis
file_name: filepath to output
language: language setting (ja, en, zh, ko)
engine: speech synthesis engine setting (nict or google)
nict: supports ja, en, zh, ko
google: supports ja, en
voice_font: voice font setting
nict(ja): F128 or F117
nict(en): EF007
nict(zh): CJF101
nict(ko): KF001
google(ja/en): None
Definition at line 295 of file interface.py.
string rospeex_if::interface.ROSpeexInterface::_ACCEPT_MESSAGE_WAV_FILENAME = 'accept.wav' [static, private] |
Definition at line 38 of file interface.py.
string rospeex_if::interface.ROSpeexInterface::_NO_MESSAGE_WAV_FILENAME = 'nomessage.wav' [static, private] |
Definition at line 37 of file interface.py.
Definition at line 40 of file interface.py.
Definition at line 40 of file interface.py.
Definition at line 40 of file interface.py.
Definition at line 71 of file interface.py.
Definition at line 40 of file interface.py.
Definition at line 40 of file interface.py.
string rospeex_if::interface.ROSpeexInterface::_SPI_RESPONSE_TOPIC_NAME = 'spi_res' [static, private] |
Definition at line 35 of file interface.py.
string rospeex_if::interface.ROSpeexInterface::_SPI_STATE_TOPIC_NAME = 'ss_state' [static, private] |
Definition at line 36 of file interface.py.
Definition at line 71 of file interface.py.
Definition at line 40 of file interface.py.
Definition at line 40 of file interface.py.
Definition at line 40 of file interface.py.
string rospeex_if::interface.ROSpeexInterface::_SR_REQUEST_TOPIC_NAME = 'sr_req' [static, private] |
Definition at line 31 of file interface.py.
Definition at line 40 of file interface.py.
string rospeex_if::interface.ROSpeexInterface::_SR_RESPONSE_TOPIC_NAME = 'sr_res' [static, private] |
Definition at line 32 of file interface.py.
Definition at line 71 of file interface.py.
Definition at line 40 of file interface.py.
string rospeex_if::interface.ROSpeexInterface::_SS_REQUEST_TOPIC_NAME = 'ss_req' [static, private] |
Definition at line 33 of file interface.py.
Definition at line 40 of file interface.py.
string rospeex_if::interface.ROSpeexInterface::_SS_RESPONSE_TOPIC_NAME = 'ss_res' [static, private] |
Definition at line 34 of file interface.py.