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 |
string | DEFAULT_LANGUAGE = 'ja-JP' |
int | FRAMERATE = 16000 |
list | LANGUAGES = ['en', 'ko', 'ja', 'zh'] |
dictionary | MICROSOFT_LANGUAGES |
int | SAMPWIDTH = 2 |
tuple | UNIQUE_ID = str(uuid.uuid4()) |
string | URL = 'https://speech.platform.bing.com' |
string | USER_AGENT = 'rospeex.MicrosoftSynClient' |
Private Member Functions | |
def | _authorize |
def | _check_api_key |
def | _create_request |
def | _extract_lexical_data |
def | _extract_result_key_data |
def | _generate_id |
def | _process_data |
def | _request_microsoft_server |
Private Attributes | |
_api_key | |
_instance_id | |
_token |
SpeechRecognitionClient_Microsoft class
Definition at line 29 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient.__init__ | ( | self, | |
microsoft_api_key = None , |
|||
args, | |||
kwargs | |||
) |
initialize function
Definition at line 47 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient._authorize | ( | self | ) | [private] |
send web authorization request to server
Definition at line 53 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient._check_api_key | ( | self | ) | [private] |
check api key
Definition at line 137 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient._create_request | ( | self, | |
language, | |||
data | |||
) | [private] |
create http request data for microsoft speech api @param language: speech data language @type language: str @param data: speech binary data @type data: str
Definition at line 192 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient._extract_lexical_data | ( | cls, | |
input_data | |||
) | [private] |
extract lexical data from server response @param input_data: @type input_data: dict() @returns: extract lexical data from server response as result data @rtype: str or unicode
Definition at line 267 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient._extract_result_key_data | ( | cls, | |
input_data | |||
) | [private] |
extract result data from server response @param input_data: @type input_data: dict() @returns: extract result data from serer response @rtype: str or unicode
Definition at line 242 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient._generate_id | ( | cls | ) | [private] |
Definition at line 335 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient._process_data | ( | self, | |
input_str | |||
) | [private] |
Definition at line 224 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient._request_microsoft_server | ( | self, | |
api_key, | |||
language, | |||
data, | |||
timeout | |||
) | [private] |
speech recognition request to microsoft server (use speech api) @param api_key: microsoft api key @type api_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 144 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient.add_streaming_packet | ( | self, | |
packet_type, | |||
packet_data | |||
) |
add streaming packet @param packet_type: @type packet_type: int @param packet_data: @type packet_data: str
Reimplemented from rospeex_core.sr.base.client.IClient.
Definition at line 292 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.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 326 of file microsoft/sync_client.py.
register streaming result callback @param cb: @type cb:
Reimplemented from rospeex_core.sr.base.client.IClient.
Definition at line 302 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.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 72 of file microsoft/sync_client.py.
def rospeex_core.sr.microsoft.sync_client.SyncClient.set_streaming_config | ( | self, | |
language | |||
) |
set streaming config @param language: @type language: str
Definition at line 318 of file microsoft/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 285 of file microsoft/sync_client.py.
unregister streaming result callback @param cb: @type cb:
Reimplemented from rospeex_core.sr.base.client.IClient.
Definition at line 310 of file microsoft/sync_client.py.
Definition at line 47 of file microsoft/sync_client.py.
Definition at line 47 of file microsoft/sync_client.py.
Definition at line 47 of file microsoft/sync_client.py.
int rospeex_core::sr::microsoft::sync_client.SyncClient::AUDIO_LENGTH = 16000 [static] |
Definition at line 31 of file microsoft/sync_client.py.
int rospeex_core::sr::microsoft::sync_client.SyncClient::CHANNELS = 1 [static] |
Definition at line 33 of file microsoft/sync_client.py.
string rospeex_core::sr::microsoft::sync_client.SyncClient::DEFAULT_LANGUAGE = 'ja-JP' [static] |
Definition at line 42 of file microsoft/sync_client.py.
int rospeex_core::sr::microsoft::sync_client.SyncClient::FRAMERATE = 16000 [static] |
Definition at line 32 of file microsoft/sync_client.py.
list rospeex_core::sr::microsoft::sync_client.SyncClient::LANGUAGES = ['en', 'ko', 'ja', 'zh'] [static] |
Definition at line 35 of file microsoft/sync_client.py.
dictionary rospeex_core::sr::microsoft::sync_client.SyncClient::MICROSOFT_LANGUAGES [static] |
{ 'en': 'en-US', 'ko': 'ko-KR', 'ja': 'ja-JP', 'zh': 'zh-CN' }
Definition at line 36 of file microsoft/sync_client.py.
int rospeex_core::sr::microsoft::sync_client.SyncClient::SAMPWIDTH = 2 [static] |
Definition at line 34 of file microsoft/sync_client.py.
tuple rospeex_core::sr::microsoft::sync_client.SyncClient::UNIQUE_ID = str(uuid.uuid4()) [static] |
Definition at line 45 of file microsoft/sync_client.py.
string rospeex_core::sr::microsoft::sync_client.SyncClient::URL = 'https://speech.platform.bing.com' [static] |
Definition at line 43 of file microsoft/sync_client.py.
string rospeex_core::sr::microsoft::sync_client.SyncClient::USER_AGENT = 'rospeex.MicrosoftSynClient' [static] |
Definition at line 44 of file microsoft/sync_client.py.