Public Member Functions | |
def | __init__ |
def | add_streaming_packet |
def | join |
def | register_streaming_cb |
def | request |
def | set_streaming_config |
def | support_streaming |
def | unregister_streaming_cb |
Static Public Attributes | |
int | AUDIO_LENGTH = 16000 |
int | CHANNELS = 1 |
int | FRAMERATE = 16000 |
list | LANGUAGES = ['ja', 'en'] |
int | SAMPWIDTH = 2 |
string | URL = 'https://www.google.com/speech-api/v2/recognize?' |
Private Member Functions | |
def | _check_api_key |
def | _create_request |
def | _extract_alternative_final_key_data |
def | _extract_final_data |
def | _extract_result_key_data |
def | _extract_transcript_data |
def | _process_data |
def | _request_google_server |
Private Attributes | |
_api_key |
SpeechRecognitionClient_Google class
Definition at line 23 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient.__init__ | ( | self, | |
google_api_key = None , |
|||
args, | |||
kwargs | |||
) |
initialize function
Definition at line 32 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient._check_api_key | ( | self | ) | [private] |
check api key
Definition at line 88 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient._create_request | ( | self, | |
access_key, | |||
language, | |||
data | |||
) | [private] |
create http request data for google speech api v2 @param access_key: google speech api key @type access_key: str @param language: speech data language @type language: str @param data: speech binary data @type data: str
Definition at line 143 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient._extract_alternative_final_key_data | ( | cls, | |
input_data | |||
) | [private] |
extract alternative key data @param input_data: @type input_data: dict()
Definition at line 206 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient._extract_final_data | ( | cls, | |
intput_data | |||
) | [private] |
extract final data from server response @param input_data: @type input_data: dict()
Definition at line 223 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient._extract_result_key_data | ( | cls, | |
input_data | |||
) | [private] |
extract result data from server response @param input_data: @type input_data: dict()
Definition at line 183 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient._extract_transcript_data | ( | cls, | |
input_data | |||
) | [private] |
extract transcript data from server response @param input_data: @type input_data: dict()
Definition at line 241 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient._process_data | ( | self, | |
input_str | |||
) | [private] |
Definition at line 162 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient._request_google_server | ( | self, | |
access_key, | |||
language, | |||
data, | |||
timeout | |||
) | [private] |
speech recognition request to google server (use speech api v2) @param access_key: google speech api key @type access_key: str @param language: speech data language @type language: str @param data: speech binary data @type data: str @param timeout: timeout time [s] @type timeout: int @raise SpeechRecognitionException:
Definition at line 95 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient.add_streaming_packet | ( | self, | |
packet_type, | |||
packet_data | |||
) |
add streaming packet @param packet_type: @type packet_type: int @param packet_data: @param packet_data: str
Reimplemented from rospeex_core.sr.base.client.IClient.
Definition at line 266 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient.join | ( | self, | |
timeout = None |
|||
) |
join streaming client @param timeout: @type timeout:
Reimplemented from rospeex_core.sr.base.client.IClient.
Definition at line 298 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient.register_streaming_cb | ( | self, | |
cb | |||
) |
register streaming result callback @param cb: @type cb:
Reimplemented from rospeex_core.sr.base.client.IClient.
Definition at line 276 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient.request | ( | self, | |
data, | |||
language = 'ja' , |
|||
timeout = socket._GLOBAL_DEFAULT_TIMEOUT |
|||
) |
send speech recognition request to server @param data: speech binary data @type data: str @param language: speech data language @type language: str @param timeout: time out time[ms] @type timeout: int
Reimplemented from rospeex_core.sr.base.client.IClient.
Definition at line 37 of file google/sync_client.py.
def rospeex_core.sr.google.sync_client.SyncClient.set_streaming_config | ( | self, | |
language | |||
) |
set streaming config @param language:
Definition at line 292 of file google/sync_client.py.
check support streaming @returns: True for support streaming / False for NOT support streaming
Reimplemented from rospeex_core.sr.base.client.IClient.
Definition at line 259 of file google/sync_client.py.
unregister streaming result callback @param cb: @type cb:
Reimplemented from rospeex_core.sr.base.client.IClient.
Definition at line 284 of file google/sync_client.py.
Definition at line 32 of file google/sync_client.py.
int rospeex_core::sr::google::sync_client.SyncClient::AUDIO_LENGTH = 16000 [static] |
Definition at line 25 of file google/sync_client.py.
int rospeex_core::sr::google::sync_client.SyncClient::CHANNELS = 1 [static] |
Definition at line 27 of file google/sync_client.py.
int rospeex_core::sr::google::sync_client.SyncClient::FRAMERATE = 16000 [static] |
Definition at line 26 of file google/sync_client.py.
list rospeex_core::sr::google::sync_client.SyncClient::LANGUAGES = ['ja', 'en'] [static] |
Definition at line 29 of file google/sync_client.py.
int rospeex_core::sr::google::sync_client.SyncClient::SAMPWIDTH = 2 [static] |
Definition at line 28 of file google/sync_client.py.
string rospeex_core::sr::google::sync_client.SyncClient::URL = 'https://www.google.com/speech-api/v2/recognize?' [static] |
Definition at line 30 of file google/sync_client.py.