SmillingMan - 2007-10-15

Hi,

I have written a very simple application to listen for 5 utterances and recognize them. The problem is that the recognition of the first utterance always starts before anything is said. This is my code:

if (microphone.startRecording())
{

    /* the microphone will keep recording until the program exits */

        for (int i = 0; i < 5; i++)
        {

        System.out.println("Say Something!");
        microphone.clear();
        Result result = recognizer.recognize();
        System.out.println("I heard: " + result.getBestResultNoFiller());
        System.out.println("Calculation finished at: " + (Calendar.getInstance().getTimeInMillis()));         
        }
        System.exit(0);

    }

}

I tried the clear command and it works for all the other utternaces except the first one. Can anyone please help?

Thanks,
Foad