mp4 empty result with c# library
- 主要言語
- Jupyter Notebook
- スター
- 15.1k
- フォーク
- 1.8k
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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);
}
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。