mp4 empty result with c# library
- 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, trying to run the example code for C# with mp4 and wav files. Just running the example code, for mp4 it's showing empty results and for wav it's not empty but transcript quite far from the actual speech. Wondering what am I missing?
I'm using this model: http://alphacephei.com/vosk/models/vosk-model-en-us-0.20.zip
Please find uploaded mp4, wav files and the resulting transcripts here: https://www.dropbox.com/sh/2ng1nweuqim0e8x/AADtgqmWUGFfktODSzz_Jje8a?dl=0
This is the code I am running:
```
static void Main(string[] args)
{
var model = new Model("model");
const float SAMPLE_RATE = 44100.0f;
DemoBytes(model, "howtospeak_short.mp4", SAMPLE_RATE);
}
public static void DemoBytes(Model model, string speechFilePath, float sampleRate)
{
// Demo byte buffer
VoskRecognizer rec = new VoskRecognizer(model, sampleRate);
rec.SetMaxAlternatives(0);
rec.SetWords(true);
using (Stream source = File.OpenRead(speechFilePath))
{
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = source.Read(buffer, 0, buffer.Length)) > 0)
{
if (rec.AcceptWaveform(buffer, bytesRead))
{
OutputResults(rec.Result());
}
else
{
OutputResults(rec.PartialResult());
}
}
}
OutputResults(rec.FinalResult());
}
private static void OutputResults(string result)
{
File.AppendAllText("C:\\temp\\transscript.txt", result);
}
```
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á.