mp4 empty result with c# library
- Lenguaje dominante
- Jupyter Notebook
- Estrellas
- 15.1k
- Forks
- 1.8k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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);
}
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.