解决vosk中文乱码问题

This commit is contained in:
dengwenjie
2025-12-23 14:24:21 +08:00
parent b0736c6494
commit a707e41d9d
2 changed files with 8 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ public class VoskRecognizer implements SpeechRecognizer{
@Override
public void loadModel(AsrModelConfig config) {
this.config = config;
//防止中文乱码
System.setProperty("jna.encoding","utf-8");
if(StringUtils.isBlank(config.getModelPath())){
throw new AsrException("modelPath is null");
}