P
P
Personal Computer2021-06-15 09:27:32
Python
Personal Computer, 2021-06-15 09:27:32

Why does python 3.6.0 crash with VOSK library?

python crashes when using

from vosk import Model, KaldiRecognizer
import os
import pyaudio

model = Model(r"/home/user/vosk-model-ru-0.10") # полный путь к модели
rec = KaldiRecognizer(model, 8000)
p = pyaudio.PyAudio()
stream = p.open(
    format=pyaudio.paInt16, 
    channels=1, 
    rate=8000, 
    input=True, 
    frames_per_buffer=8000
)
stream.start_stream()

while True:
    data = stream.read(4000)
    if len(data) == 0:
        break

    print(rec.Result() if rec.AcceptWaveform(data) else rec.PartialResult())

print(rec.FinalResult())
calling with python 3.6.0 of the VOSK library

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Personal Computer, 2021-06-15
@PCbotru

60c867287e89b876621230.png Problem event name: APPCRASH
Application name: pythonw.exe
Application version: 3.6.150.1013
Application timestamp: 585cdba6 Faulting
module name: KERNELBASE.dll Faulting
module version: 6.3.9600.20040 Faulting
module timestamp: 60adc0a6 Exception
code: 20474343
Offset exceptions: 0000000000007afc
OS version: 6.3.9600.2.0.0.768.101
language code 1049
Additional information 1: e4d9
Additional information 2: e4d9f57d2749168e4137b03c80682138
more information 3: 46ce
more information 4: 46ce65ca58331a954f33cd3a5a65b7c3
Read our privacy statement online:
go.microsoft.com/fwlink/?linkid=280262
If the online privacy statement is not available, see its local version:
C:\WINDOWS\system32\en-US\erofflps.txt
=" https://habrastorage.org/ webt/60/c8/66/60c866d9b38... "alt="image"/>

N
nshmyrev, 2022-03-04
@nshmyrev

An example for microphone recognition can be found here:
https://github.com/alphacep/vosk-api/blob/master/p...
We do not recommend using pyaudio.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question