I have the same problem. After first commit(), calling setRecordStream() throws IllegalStateException: "startRecord() has been called and commit has not been called". Scheme looks like this:
Player p= Manager.createPlayer("capture://audio?encoding=pcm");
RecordControl rc= (RecordControl)p.getControl("RecordControl");
ByteArrayOutputStream nbos= new ByteArrayOutputStream();
byte barr= nbos.toByteArray(); // up to here everything is ok and i get my recorded bytes
Thread.sleep(5000); // let's wait a moment before starting next recording
rc.setRecordStream(nbos); //this line throws IllegalStateException
//I also tried rc.setRecordStream(new ByteArrayOutputStream()); but no effect
It's obvious that commit() is called befere second setRecordStream() but exception states otherwise
Has anyone handled this?
Maybe author of this thread solved this?
Any help appreciated :)
Problem similar to this [url http://forums.oracle.com/forums/thread.jspa?threadID=1700471&tstart=0]one