Package javax.sound.sampled

Examples of javax.sound.sampled.SourceDataLine.stop()


            l = is.read(buf, 0, 1024);
            line.write(buf, 0, l);
//  os.write(buf, 0, l);
        }
        line.drain();
        line.stop();
        line.close();
//  os.close();
    }
}
View Full Code Here


        sl.write(ba, 0, numBytesRead); // in Tonausgabe schreiben
      }
      baOut.close(); // close() ist wichtig, k�nnten noch Daten gepuffert
              // sein
      tl.stop(); // eingabe stoppen
      sl.stop(); // ausgabe stoppen
      tl.close(); // eingabe schliessen
      sl.close(); // ausgabe schliessen
      ba = baOut.toByteArray(); // ba liegt brach ruhig wieder verwenden
      ByteArrayInputStream baIn = new ByteArrayInputStream(ba);
      AudioInputStream stream = new AudioInputStream(baIn, af, ba.length
View Full Code Here

            LOG.log(Level.SEVERE, null, ex);
            return;
        }
        player.play(in);

        line.stop();
        line.close();
    }

    /**
     * inits jorbis
View Full Code Here

                }
            }

            // stop line
            line.drain();
            line.stop();
            line.close();

            // stop input stream
            dataIn.close();
        }
View Full Code Here

      sourceDataLine.write(rawSamples, 0, rawSamples.length);
    }

    // Shutdown.
    sourceDataLine.drain();
    sourceDataLine.stop();
    sourceDataLine.close();
  }
}
View Full Code Here

                        for (int i = 0; i < buf.length; i++) {
                            buf[i] = (byte) (Math.sin(RAD * frequency / SAMPLE_RATE * i) * 64.0 / Math.sqrt(i));
                        }
                        source.write(buf, 0, buf.length);
                        source.drain();
                        source.stop();
                        source.close();
                    } catch (Exception e) {
                        System.out.println(e);
                    }
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.