Package javax.sound.sampled

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


        if(AudioSystem.isLineSupported(info)) {
          final SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info);

          line.open(format);
          line.start();

          new Thread("Reminder audio playing") {
            private boolean stopped;
            @Override
            public void run() {
View Full Code Here


        /*
         * Still not enough. The line now can receive data, but will not pass
         * them on to the audio output device (which means to your sound card).
         * This has to be activated.
         */
        line.start();

        /*
         * Ok, finally the line is prepared. Now comes the real job: we have to
         * write data to the line. We do this in a loop. First, we read data
         * from the AudioInputStream to a buffer. Then, we write from this
View Full Code Here

        targetDataLine.start();
       
        // open the audio output
        sourceDataLine = (SourceDataLine) AudioSystem.getLine(outputLineInfo);
        sourceDataLine.open(outputAudioFormat, bOutputBuffer.length);
        sourceDataLine.start();
      } catch (LineUnavailableException lue) {
        lue.printStackTrace(System.err);
        System.exit(1);
      }
     
View Full Code Here

            } else if (this.curPosition == Position.LEFT) {
                pan.setValue(-1.0f);
            }
        }

        auline.start();
        int nBytesRead = 0;
        final byte[] abData = new byte[AePlayWave.EXTERNAL_BUFFER_SIZE];

        try {
            while (nBytesRead != -1) {
View Full Code Here

      AudioInputStream din) throws IOException, LineUnavailableException {
    byte[] data = new byte[4096];
    SourceDataLine line = getLine(targetFormat);
    if (line != null) {
      // Start
      line.start();
      int nBytesRead = 0, nBytesWritten = 0;
      while (nBytesRead != -1) {
        nBytesRead = din.read(data, 0, data.length);
        if (nBytesRead != -1) {
          nBytesWritten = line.write(data, 0, nBytesRead);
View Full Code Here

        data = new byte[4096];
        SourceDataLine line = getLine(targetFormat);

        if (line != null) {
            // Start
            line.start();
            int nBytesRead = 0, nBytesWritten = 0;
            bytes = 0;

            while (nBytesRead != -1) {
                nBytesRead = din.read(data, 0, data.length);
View Full Code Here

    byte[] data = new byte[4096];
    SourceDataLine line = getLine(targetFormat);   
    if (line != null)
    {
      // Start
      line.start();
      int nBytesRead = 0, nBytesWritten = 0;
      while (nBytesRead != -1)
      {
      nBytesRead = din.read(data, 0, data.length);
      if (nBytesRead != -1) nBytesWritten = line.write(data, 0, nBytesRead);
View Full Code Here

        byte[] data = new byte[4096];
        SourceDataLine line = getLine(targetFormat);       
        if (line != null)
        {
          // Start
          line.start();
          int nBytesRead = 0, nBytesWritten = 0;
          while (nBytesRead != -1)
          {
            nBytesRead = din.read(data, 0, data.length);
            if (nBytesRead != -1) nBytesWritten = line.write(data, 0, nBytesRead);
View Full Code Here

            source_data_line.open(audio_format);
        } catch (LineUnavailableException e) {
            System.out.println(e);
            System.exit(0);
        }
        source_data_line.start();
        return source_data_line;
    }


    /**
 
View Full Code Here

        line = (SourceDataLine) AudioSystem.getLine(info);

        // open the line and start the line

        line.open(audioFormat);
        line.start();
        mAudioLines.put(streamIndex, line);

        // if mDataLine is not yet defined, do so

        if (null == mDataLine)
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.