24 lines
430 B
Python
24 lines
430 B
Python
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
import warnings
|
|
|
|
from speech import Speech
|
|
|
|
if not sys.warnoptions:
|
|
warnings.simplefilter("ignore")
|
|
|
|
|
|
def _main():
|
|
if len(sys.argv) < 2:
|
|
print(f'Usage: {sys.argv[0]} FILE')
|
|
exit(1)
|
|
wav_file = sys.argv[1]
|
|
speech_server = 'http://vosk.athene.tech'
|
|
text = Speech().run(wav_file, speech_server)
|
|
print(f'Text: {text}')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
_main()
|