Fixed bug in Microphone when calling startRecording() and stopRecording() subsequently will cause an IOException. The reason the bug happened was that the previous recording thread did not finish reading all the audio data, and thus the audio line was still active when the next startRecording() was called. The new recording thread ended up reading from the same audio line, which at some point was closed by the previous thread, causing an IO Exception for the read. The fix is that the stopRecording() method will always wait until all the data is read and the previous recording thread terminates, before it returns.
Fixed bug in Microphone when calling startRecording() and stopRecording() subsequently will cause an IOException. The reason the bug happened was that the previous recording thread did not finish reading all the audio data, and thus the audio line was still active when the next startRecording() was called. The new recording thread ended up reading from the same audio line, which at some point was closed by the previous thread, causing an IO Exception for the read. The fix is that the stopRecording() method will always wait until all the data is read and the previous recording thread terminates, before it returns.


git-svn-id: a8b04003a33e1d3e001b9d20391fa392a9f62d91@3496 94700074-3cef-4d97-a70e-9c8c206c02f5

deepstupid/sphinx5