Fix speech class
This commit is contained in:
parent
3743773c67
commit
608f9c264c
@ -25,7 +25,7 @@ class Speech:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __stt(wav_file: str, server: str) -> str:
|
def __stt(wav_file, server):
|
||||||
print(f'Connecting to \'{server}\'...')
|
print(f'Connecting to \'{server}\'...')
|
||||||
request = Request(url=f'{server}/stt',
|
request = Request(url=f'{server}/stt',
|
||||||
data=Speech.__load_wav(wav_file),
|
data=Speech.__load_wav(wav_file),
|
||||||
@ -36,5 +36,5 @@ class Speech:
|
|||||||
raise RuntimeError(f'Wrong reply from server: {result}')
|
raise RuntimeError(f'Wrong reply from server: {result}')
|
||||||
return result['text'] if not result['code'] else f'Server error: {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)
|
return self.__stt(wav_file, server)
|
||||||
|
Loading…
Reference in New Issue
Block a user