forked from tykayn/transcription
Mise à jour de conversion_simple_fr.py
Transformation de models/fr en model
This commit is contained in:
parent
0396ea436f
commit
b322a2b26e
@ -7,8 +7,8 @@ import wave
|
|||||||
|
|
||||||
SetLogLevel(0)
|
SetLogLevel(0)
|
||||||
|
|
||||||
if not os.path.exists("models/fr"):
|
if not os.path.exists("model"):
|
||||||
print ("Please download the model from https://alphacephei.com/vosk/models and unpack as 'models' in the current folder.")
|
print ("Please download the model from https://alphacephei.com/vosk/models and unpack as 'model' in the current folder.")
|
||||||
exit (1)
|
exit (1)
|
||||||
|
|
||||||
wf = wave.open(sys.argv[1], "rb")
|
wf = wave.open(sys.argv[1], "rb")
|
||||||
@ -16,7 +16,7 @@ if wf.getnchannels() != 1 or wf.getsampwidth() != 2 or wf.getcomptype() != "NONE
|
|||||||
print ("Audio file must be WAV format mono PCM.")
|
print ("Audio file must be WAV format mono PCM.")
|
||||||
exit (1)
|
exit (1)
|
||||||
|
|
||||||
model = Model("models/fr")
|
model = Model("model")
|
||||||
rec = KaldiRecognizer(model, wf.getframerate())
|
rec = KaldiRecognizer(model, wf.getframerate())
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
Loading…
Reference in New Issue
Block a user