小编Man*_*aee的帖子

在android上使用pocketsphinx未检测到关键字

任何人都可以解释我如何使用pocketsphinx将我的演讲转换成文本吗?我试试这个:

import com.example.speechtutor.SpeechRecognizerRecorder;
import com.example.speechtutor.SpeechRecognizerRecorderSetup;
import edu.cmu.pocketsphinx.Hypothesis;
import edu.cmu.pocketsphinx.RecognitionListener;
import static edu.cmu.pocketsphinx.Assets.syncAssets;

public class SpeakActivity extends Activity implements RecognitionListener {


SpeechRecognizerRecorder recognizer;

private File appDir;

 String filePath;

 private static final String KWS_SEARCH_NAME = "wakeup";
 private static final String FORECAST_SEARCH = "forecast";
 private static final String DIGITS_SEARCH = "digits";
 private static final String MENU_SEARCH = "menu";
 private static final String KEYPHRASE = "hello";


 @Override
 public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_speak);

try {
    Log.d("Tag","before trying to sync assets");
    appDir = syncAssets(getApplicationContext()); …
Run Code Online (Sandbox Code Playgroud)

android speech-recognition pocketsphinx-android

3
推荐指数
1
解决办法
5225
查看次数

Android将毫秒转换为小时

我在字符串中有毫秒数,我希望从中得到小时和分钟.

这是我的code:

String ms = "1425652847915";
int t = Integer.parseInt(ms);

Calendar c = Calendar.getInstance();
c.set(Calendar.MILLISECOND, t);

int  h = c.get(Calendar.HOUR_OF_DAY);
int  m = c.get(Calendar.MINUTE); 
Run Code Online (Sandbox Code Playgroud)

但我得到了这个error:

java.lang.NumberFormatException:无法将'1425652847915'解析为整数

有什么建议吗?

java time android calendar parseint

0
推荐指数
1
解决办法
2876
查看次数