Fix speech class

This commit is contained in:
Aleksey Filippov 2022-01-14 17:05:27 +04:00
parent 3743773c67
commit 608f9c264c

View File

@ -25,7 +25,7 @@ class Speech:
return result
@staticmethod
def __stt(wav_file: str, server: str) -> str:
def __stt(wav_file, server):
print(f'Connecting to \'{server}\'...')
request = Request(url=f'{server}/stt',
data=Speech.__load_wav(wav_file),
@ -36,5 +36,5 @@ class Speech:
raise RuntimeError(f'Wrong reply from server: {result}')
return result['text'] if not result['code'] else f'Server error: {result}'
def run(self, wav_file, server):
def run(self, wav_file: str, server: str) -> str:
return self.__stt(wav_file, server)