Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
rospeex_if.interface.ROSpeexInterface Class Reference

List of all members.

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

Static Public Attributes

list TEXT_RANGE = [0, 100]

Private Member Functions

def _check_text
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_config_srv
 _spi_enable
 _spi_engine
 _spi_language
 _sr_enable
 _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_CONFIG_SERVICE_NAME = 'spi_config'
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'

Detailed Description

class:
    ROSpeexInterface class
brief:
    Provides rospeex interface for python.

Definition at line 21 of file interface.py.


Constructor & Destructor Documentation

Definition at line 40 of file interface.py.


Member Function Documentation

def rospeex_if.interface.ROSpeexInterface._check_text (   self,
  text 
) [private]
brief:
    check tts text
param[in]:
    text: input mesage

Definition at line 377 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 161 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 143 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 173 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 205 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 184 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 123 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, id, my, th, vi, fr, es)

    engine:  speech recognition engine setting (nict or google)

    nict: supports ja, en, zh, ko, id, my, th, vi, fr, es

    google: supports ja, en

Definition at line 349 of file interface.py.

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.

brief:
    Registering a speech synthesis callback function.
param[in]:
    func:  form: func(data)

data: speech synthesis result audio file (wave)

Definition at line 194 of file interface.py.

def rospeex_if.interface.ROSpeexInterface.say (   self,
  message,
  language = 'ja',
  engine = 'nict',
  voice_font = '*',
  limit = True 
)
brief:
    Performs speech synthesis, and outputs to the speaker.
param[in]:
    message:  text for performing speech synthesis

    language:  language setting (ja, en, zh, ko, id, my, th, vi)

    engine:  speech synthesis engine setting (nict or google)

    nict: supports ja, en, zh, ko, id, my, th, vi

    google: supports ja, en

    voice_font:  voice font setting

    nict(ja): F128 or F117

    nict(en): EF007

    nict(zh): CJF101

    nict(ko): KF001

    nict(id/my/th/vi): None

    google(ja/en): None

    limit: limit for message string length

    (True:limit to 100 characters, False:no limit)

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, id, my, th, vi, fr, es)

    engine:  speech recognition engine setting (nict or google)

    nict: supports ja, en, zh, ko, id, my, th, vi, fr, es

    google: supports ja, en

Definition at line 230 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, id, my, th, vi)

    engine:  speech synthesis engine setting (nict or google)

    nict: supports ja, en, zh, ko, id, my, th, vi

    google: supports ja, en

    voice_font:  voice font setting

    nict(ja): F128 or F117

    nict(en): EF007

    nict(zh): CJF101

    nict(ko): KF001

    nict(id/my/th/vi): None

    google(ja/en): None

Definition at line 301 of file interface.py.


Member Data Documentation

Definition at line 36 of file interface.py.

string rospeex_if::interface.ROSpeexInterface::_NO_MESSAGE_WAV_FILENAME = 'nomessage.wav' [static, private]

Definition at line 35 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 34 of file interface.py.

Definition at line 40 of file interface.py.

Definition at line 69 of file interface.py.

Definition at line 40 of file interface.py.

Definition at line 40 of file interface.py.

Definition at line 32 of file interface.py.

Definition at line 33 of file interface.py.

Definition at line 69 of file interface.py.

Definition at line 40 of file interface.py.

Definition at line 28 of file interface.py.

Definition at line 40 of file interface.py.

Definition at line 29 of file interface.py.

Definition at line 69 of file interface.py.

Definition at line 40 of file interface.py.

Definition at line 30 of file interface.py.

Definition at line 40 of file interface.py.

Definition at line 31 of file interface.py.

Definition at line 38 of file interface.py.


The documentation for this class was generated from the following file:


rospeex_if
Author(s): Komei Sugiura
autogenerated on Thu Jun 6 2019 18:53:13