Open rancekk opened 2 years ago
import java.nio.charset.StandardCharsets;
...
String chineseString = "[\"一 零 零 零 一\", " + "\"幺 零 一 二 三 四 五 六 七 八 九\", \"[unk]\"]";
byte[] chineseBytesArray = chineseString.getBytes();
String encodedChineseString = new String(chineseBytesArray, StandardCharsets.UTF_8);
Recognizer rec = new Recognizer(model, 16000.f, encodedChineseString);
// Recognizer rec = new Recognizer(model, 16000.f, "[\"one zero zero zero one\", " +
// "\"oh zero one two three four five six seven eight nine\", \"[unk]\"]");
reference: UTF-8 java string
When using Chinese model to identify audio files, all returned are empty