mp4 empty result with c# library
- Lingua principale
- Jupyter Notebook
- Stelle
- 15.1k
- Fork
- 1.8k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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);
}
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.