|
13 | 13 |
|
14 | 14 |
|
15 | 15 | class CloudClient: |
16 | | - """ Spokestack client for cloud based speech to text |
| 16 | + """Spokestack client for cloud based speech to text |
17 | 17 |
|
18 | | - Args: |
19 | | - key_id (str): identity from spokestack api credentials |
20 | | - key_secret (str): secret key from spokestack api credentials |
21 | | - socket_url (str): url for socket connection |
22 | | - audio_format (str): format of input audio |
23 | | - sample_rate (int): audio sample rate (kHz) |
24 | | - language (str): language for recognition |
25 | | - limit (int): Limit of messages per api response |
26 | | - idle_timeout (Any): Time before client timeout. Defaults to None |
| 18 | + Args: |
| 19 | + key_id (str): identity from spokestack api credentials |
| 20 | + key_secret (str): secret key from spokestack api credentials |
| 21 | + socket_url (str): url for socket connection |
| 22 | + audio_format (str): format of input audio |
| 23 | + sample_rate (int): audio sample rate (kHz) |
| 24 | + language (str): language for recognition |
| 25 | + limit (int): Limit of messages per api response |
| 26 | + idle_timeout (Any): Time before client timeout. Defaults to None |
27 | 27 | """ |
28 | 28 |
|
29 | 29 | def __init__( |
@@ -66,7 +66,7 @@ def __init__( |
66 | 66 | self._idle_count: int = 0 |
67 | 67 |
|
68 | 68 | def __call__(self, audio: Union[bytes, np.ndarray], limit: int = 1) -> List[str]: |
69 | | - """ Audio to text interface for the cloud client |
| 69 | + """Audio to text interface for the cloud client |
70 | 70 |
|
71 | 71 | Args: |
72 | 72 | audio (bytes|np.ndarray): input audio can be in the form of |
@@ -138,7 +138,7 @@ def disconnect(self) -> None: |
138 | 138 | self._socket = None |
139 | 139 |
|
140 | 140 | def send(self, frame: np.ndarray): |
141 | | - """ sends a single frame of audio |
| 141 | + """sends a single frame of audio |
142 | 142 |
|
143 | 143 | Args: |
144 | 144 | frame (np.ndarray): segment of PCM-16 encoded audio |
@@ -197,7 +197,7 @@ def idle_count(self, value: int): |
197 | 197 |
|
198 | 198 |
|
199 | 199 | class APIError(Exception): |
200 | | - """ Spokestack api error pass through |
| 200 | + """Spokestack api error pass through |
201 | 201 |
|
202 | 202 | Args: |
203 | 203 | response (dict): message from the api service |
|
0 commit comments