3
객관식 질문이있는 수학 게임이 있습니다. 나는 정답은 벨 소리를, 오답은 오인 (oink) 소리를 낸다. 플레이어가 신속하게 답변을 입력하도록 권장하는 시간 지정 재생 모드가 있습니다. 응답 버튼을 천천히 누르면 소리가 잘 들립니다. 그러나 빠른 연속으로 소리가 들리지 않으면.연속적인 버튼 클릭 후 Android 사운드가 재생되지 않습니다.
두 개의 소리는 각각 1 초의 일부입니다. 내가 ting.start();
이 정답을 처리하는 방법에
oink.start();
한 가지가 강제로 내가 원하는 단지를 시작 후 두 소리를 중지하는 것이 었습니다 오답 방법에 아래 참조)하지만 소리는 전혀 재생되지 않습니다! 어떤 제안?
private void handleWrongAnswer(int chosenID)
{
// Toast.makeText(getApplicationContext(), "Oops, try again.", Toast.LENGTH_SHORT).show();
Button checked_button = (Button) findViewById(chosenID);
checked_button.setEnabled(false);
checked_button.setClickable(false);
checked_button.setBackgroundColor(Color.rgb(255,100,100));
score = score - 1.0/3.0;
score_field.setText(String.format("%.2f", score));
ting.stop();
oink.stop();
oink.start();
}