Package javax.sound.sampled

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


        final DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);

        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
View Full Code Here


            /*
             * The line is there, but it is not yet ready to receive audio data.
             * We have to open the line.
             */
            line.open(audioFormat);
        } catch (LineUnavailableException e) {
            com.valhalla.Logger.logException(e);
        } catch (Exception e) {
            com.valhalla.Logger.logException(e);
        }
View Full Code Here

        if(mSystemMixer != null && mSystemMixer.isLineSupported(info) && mSystemOutputs.size() < mMaxNumLines)
        {
            try
            {
                SourceDataLine line = (SourceDataLine)mSystemMixer.getLine(info);
                line.open();

        SystemOutput output = new SystemOutput(line);

        synchronized(mSystemOutputs)
        {
View Full Code Here

      DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat, AudioSystem.NOT_SPECIFIED);

      try
            {
                SourceDataLine line = (SourceDataLine)mSystemMixer.getLine(info);
                line.open();

        mMixSystemOutput = new SystemOutput(line);
        mMaxNumLines     = mSystemMixer.getMaxLines(info);
        mMaxNumLines     = (mMaxNumLines == AudioSystem.NOT_SPECIFIED) ? (Integer.MAX_VALUE) : (mMaxNumLines);
        mMaxNumLines     = Math.min(useMaxMixerLines, (mMaxNumLines - 1));
View Full Code Here

            DataLine.Info datalineInfo = new DataLine.Info(SourceDataLine.class, audioFormat, AudioSystem.NOT_SPECIFIED);

            try
            {
                SourceDataLine line = (SourceDataLine)AudioSystem.getLine(datalineInfo);
                line.open();

        mMixSystemOutput = new SystemOutput(line);
        mMaxNumLines     = 0;
            }
            catch(LineUnavailableException e)
View Full Code Here

        mixerToUse = i;

    // Obtain and open the line.
    SourceDataLine sdl = (SourceDataLine) AudioSystem.getMixer(
        mixers[mixerToUse]).getLine(info);
    sdl.open(format);
    return sdl;
  }

  // Write to a file
  public AudioWriter(File file, AudioFormat format,
View Full Code Here

        targetDataLine.open(inputAudioFormat, bInputBuffer.length);
        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

        SourceDataLine auline = null;
        final DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);

        try {
            auline = (SourceDataLine) AudioSystem.getLine(info);
            auline.open(format);
        } catch (final LineUnavailableException e) {
            e.printStackTrace();
            return;
        } catch (final Exception e) {
            e.printStackTrace();
View Full Code Here

      throws LineUnavailableException {
    SourceDataLine res = null;
    DataLine.Info info = new DataLine.Info(SourceDataLine.class,
        audioFormat);
    res = (SourceDataLine) AudioSystem.getLine(info);
    res.open(audioFormat);
    return res;
  }

  private synchronized void rawplay(AudioFormat targetFormat,
      AudioInputStream din) throws IOException, LineUnavailableException {
View Full Code Here

    private SourceDataLine getLine(AudioFormat audioFormat) throws LineUnavailableException {
        SourceDataLine res = null;
        DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);
        res = (SourceDataLine) AudioSystem.getLine(info);
        res.open(audioFormat);
        return res;
    }

    public void play(String file) {
        arquivo = file;
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.