Package javax.sound.sampled

Examples of javax.sound.sampled.TargetDataLine.open()


    DataLine.Info  info = new DataLine.Info(TargetDataLine.class, audioFormat);
    TargetDataLine  targetDataLine = null;
    try
    {
      targetDataLine = (TargetDataLine) AudioSystem.getLine(info);
      targetDataLine.open(audioFormat);
    }
    catch (LineUnavailableException e)
    {
      out("unable to get a recording line");
      e.printStackTrace();
View Full Code Here


        // TODO(mhroth): ensure that stereo input and output lines are actually being returned
        // by the system.
       
        // open the audio input (line-in or microphone)
        targetDataLine = (TargetDataLine) AudioSystem.getLine(inputLineInfo);
        targetDataLine.open(inputAudioFormat, bInputBuffer.length);
        targetDataLine.start();
       
        // open the audio output
        sourceDataLine = (SourceDataLine) AudioSystem.getLine(outputLineInfo);
        sourceDataLine.open(outputAudioFormat, bOutputBuffer.length);
View Full Code Here

  private void upChannel(String urlStr, TargetDataLine tl, AudioFormat af) throws LineUnavailableException{
    final String murl = urlStr;
    final TargetDataLine mtl = tl;
    final AudioFormat maf = af;
    if(!mtl.isOpen()){
      mtl.open(maf);
      mtl.start();
    }
    new Thread ("Upstream Thread") {
      public void run() {
        openHttpsPostConnection(murl, mtl, maf);
View Full Code Here

    final boolean isMicro = isMicrophone;
    final AudioInputStream outDinSound = outDin;

    if (isMicro) {
      try {
        line.open(format);
        line.start();
      } catch (LineUnavailableException e) {
        e.printStackTrace();
      }
    }
View Full Code Here

        DataLine.Info data_line_info = new DataLine.Info(TargetDataLine.class, audio_format);
        TargetDataLine target_data_line = null;
        target_data_line = (TargetDataLine) AudioSystem.getLine(data_line_info);
        if (listener != null)
            target_data_line.addLineListener(listener);
        target_data_line.open(audio_format);
        target_data_line.start();
        return target_data_line;
    }

View Full Code Here

        DataLine.Info data_line_info = new DataLine.Info(TargetDataLine.class, audio_format);
        TargetDataLine target_data_line = null;
        target_data_line = (TargetDataLine) mixer.getLine(data_line_info);
        if (listener != null)
            target_data_line.addLineListener(listener);
        target_data_line.open(audio_format);
        target_data_line.start();
        return target_data_line;
    }

View Full Code Here

   
    byte[] data = new byte[dataSize];
   
    try {
        line = (TargetDataLine) AudioSystem.getLine(info);
        line.open(format);
      line.read(data, 0, data.length);
      line.flush();
      line.close();
    } catch (LineUnavailableException ex) {
      throw new JbrainException(ex.getMessage());
View Full Code Here

    DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);   
    if (AudioSystem.isLineSupported(info)) {
      // Obtain and open the line.   
      try {
        TargetDataLine line = (TargetDataLine) AudioSystem.getLine(info);
          line.open(format);
         
          // Assume that the TargetDataLine, line, has already
        // been obtained and opened.
        ByteArrayOutputStream out  = new ByteArrayOutputStream();
        int numBytesRead;
View Full Code Here

      DataLine.Info info = new DataLine.Info(TargetDataLine.class,
          linearFormat);
      TargetDataLine targetDataLine = (TargetDataLine) AudioSystem
          .getLine(info);

      targetDataLine.open(linearFormat);
      targetDataLine.start();

      AudioInputStream linearStream = new AudioInputStream(targetDataLine);
      linearStream.read(voiceData, 0, voiceData.length);
      targetDataLine.stop();
View Full Code Here

       * We have to open the line.
       */
      if (DEBUG) {
        out("AudioCommon.getTargetDataLine(): opening line...");
      }
      targetDataLine.open(audioFormat, nBufferSize);
      if (DEBUG) {
        out("AudioCommon.getTargetDataLine(): opened line");
      }
    } catch (LineUnavailableException e) {
      if (DEBUG) {
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.