alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.38k stars 1.04k forks source link

Wrong formatted json if locale has other decimal seperator #1425

Closed m-fuchs closed 11 months ago

m-fuchs commented 11 months ago

Hello,

I am using the C library from Freepascal on a German system. When I compile my program with support for locale under linux, the return of vosk_recognizer_final_result is incorrect:

{
  "alternatives" : [{
      "confidence" : 535,251099,
      "text" : "dies ist der erste satz dies ist der zweite satz"
    }]
}

In the JSON here, the value of "confidence" is incorrectly encoded with a comma instead of a period.

There seems to be a problem with Vosk's JSON converter. It always has to be a period, no matter what decimal separator setting the system contains.

nshmyrev commented 11 months ago

Yes, we have this problem, same as #808