Vost-api not giving accurate results

I recently found out vosk-api was a thing and decided to give it a go, I'm using one of their example projects and a test but it keeps giving very innacurate results The audio I attached of my friend yapping gave this result
{
"text" : "shut up why are all the all the tall or close the shop for hours"
}
{
"text" : "shut up why are all the all the tall or close the shop for hours"
}
3 Replies
Protogen Posting
Protogen PostingOP4w ago
// See https://aka.ms/new-console-template for more information
using System;
using System.IO;
using Vosk;

namespace gaysiri
{
public class VoskDemo
{
public static void DemoBytes(Model model)
{
Console.WriteLine("ANAZLYZING");
// Demo byte buffer
VoskRecognizer rec = new VoskRecognizer(model, 16000.0f);
rec.SetMaxAlternatives(0);
rec.SetWords(true);
using(Stream source = File.OpenRead("test.wav")) {
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());
}

public static void Main()
{
// You can set to -1 to disable logging messages
Vosk.Vosk.SetLogLevel(0);

Model model = new Model("/home/protogenposting/Desktop/Gay Siri/gaysiri/bin/Debug/net8.0/model");
DemoBytes(model);
}
}
}
// See https://aka.ms/new-console-template for more information
using System;
using System.IO;
using Vosk;

namespace gaysiri
{
public class VoskDemo
{
public static void DemoBytes(Model model)
{
Console.WriteLine("ANAZLYZING");
// Demo byte buffer
VoskRecognizer rec = new VoskRecognizer(model, 16000.0f);
rec.SetMaxAlternatives(0);
rec.SetWords(true);
using(Stream source = File.OpenRead("test.wav")) {
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());
}

public static void Main()
{
// You can set to -1 to disable logging messages
Vosk.Vosk.SetLogLevel(0);

Model model = new Model("/home/protogenposting/Desktop/Gay Siri/gaysiri/bin/Debug/net8.0/model");
DemoBytes(model);
}
}
}
here's my code btw
Protogen Posting
Protogen PostingOP4w ago
https://alphacephei.com/vosk/models I'm using the en-us-0.22 model btw
VOSK Offline Speech Recognition API
VOSK Models
Accurate speech recognition for Android, iOS, Raspberry Pi and servers with Python, Java, C#, Swift and Node.
Protogen Posting
Protogen PostingOP4w ago
anyone know how to fix this?
Want results from more Discord servers?
Add your server