alphacep / alphacep/vosk-api

Using a microphone in C#

Đang mở
#986 12 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Jupyter Notebook
Star
15.1k
Fork
1.8k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi! I have a problem with speech recognition through a microphone using NAudio.

```cs
public class VoskDemo {
static VoskRecognizer? rec;
static WaveFileWriter? writer;

private static void WaveInOnDataAvailable(object? sender, WaveInEventArgs e) {
try {
writer.Write(e.Buffer, 0, e.BytesRecorded);

if (rec.AcceptWaveform(e.Buffer, e.BytesRecorded)) Console.WriteLine(rec.Result());
else Console.WriteLine(rec.PartialResult());
} catch { }
}

public static void Main() {
Model model = new Model("model");
rec = new VoskRecognizer(model, 16000f);

WaveInEvent waveIn = new WaveInEvent();
waveIn.WaveFormat = new WaveFormat(16000, 2);
waveIn.DataAvailable += WaveInOnDataAvailable;
waveIn.StartRecording();

writer = new WaveFileWriter(@"D:\test.wav", waveIn.WaveFormat);
while (true) { Thread.Sleep(1000); }
}
}
```

When I write to a file, you can listen to it, but Vosk does not recognize speech

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.