public void activate() {
   active = true;
   microphone.flush();
   speaker.flush();
   speaker.start();
   blocker.release();
   microphone.start();
   microphone.flush();
 }
Exemple #2
0
 public void close() throws IOException {
   if (line.isActive()) {
     line.flush();
     line.stop();
   }
   line.close();
 }
  public void deactivate() {
    active = false;
    microphone.stop();
    microphone.flush();

    speaker.stop();
    speaker.flush();
  }
 // $$fb 2001-07-16: added this method to correctly close the underlying TargetDataLine.
 // fixes bug 4479984
 public void close() throws IOException {
   // the line needs to be flushed and stopped to avoid a dead lock...
   // Probably related to bugs 4417527, 4334868, 4383457
   if (line.isActive()) {
     line.flush();
     line.stop();
   }
   line.close();
 }