alphacep / alphacep/vosk-api

Incorrect recognition with wrong data format

Abierto
#1,075 5 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
15.1k
Forks
1.8k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

This is my first time using Vosk, so please bear with me. I'm using .NET Core 6 with C# 10, Vosk 0.3.38 and the "vosk-model-en-us-0.22-lgraph" model (renamed the folder to "model"). The model appears to be loading fine, with no errors or warnings showing up.

The attached audio file says: *static* flexible rubber soles *static*

However, Vosk always outputs:
```
{
"partial" : ""
}
{
"partial" : ""
}
. . .
{
"partial" : "the"
}
{
"partial" : "the"
}
. . .
{
"result" : [{
"conf" : 1.000000,
"end" : 4.859122,
"start" : 0.140574,
"word" : "the"
}],
"text" : "the"
}
{
"partial" : ""
}
{
"partial" : ""
}
. . .
{
"result" : [{
"conf" : 1.000000,
"end" : 11.854490,
"start" : 7.685259,
"word" : "the"
}],
"text" : "the"
}
```

The output is the same even when using different audio files. I have also tried using the "vosk-model-small-en-us-0.15" model, but the output was mostly the same.

Here is the code for speech recognition:
```
void SpeechRec(string modelPath, string audioPath)
{
//Convert mp3 to wav
using (Mp3FileReader mp3 = new Mp3FileReader(audioPath))
{
using (WaveStream pcm = WaveFormatConversionStream.CreatePcmStream(mp3))
{
WaveFileWriter.CreateWaveFile(audioPath, pcm);
}
}

//Create Vosk STT
Model model = new Model(modelPath);
VoskRecognizer rec = new VoskRecognizer(model, 16000);
rec.SetMaxAlternatives(0);
rec.SetWords(true);

using (Stream source = File.OpenRead(audioPath))
{
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = source.Read(buffer, 0, buffer.Length)) > 0)
{
if (rec.AcceptWaveform(buffer, bytesRead))
{
Console.WriteLine(rec.Result());
}
else
{
Console.WriteLine(rec.PartialResult());
}
}
}
Console.WriteLine(rec.FinalResult());
}
```

To use the audio file, change the file extension from .mp4 to .mp3.

https://user-images.githubusercontent.com/49353890/179464547-3ee3a00e-2941-4443-b2a2-14165b21354f.mp4

Vosk console/debug messages.

[output.txt](https://github.com/alphacep/vosk-api/files/9130229/output.txt)

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.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.