Package javax.sound.sampled

Examples of javax.sound.sampled.SourceDataLine


    if (!(tool instanceof IMediaCoder))
      throw new UnsupportedOperationException();

    AudioQueue queue = mAudioQueues.get(streamIndex);
    IStream stream = ((IMediaCoder)tool).getContainer().getStream(streamIndex);
    SourceDataLine line = getJavaSoundLine(stream);
   
    // if no queue (and there is a line), create the queue

    if (null == queue && line != null)
    {
View Full Code Here


  private SourceDataLine getJavaSoundLine(IStream stream)
  {
    IStreamCoder audioCoder = stream.getStreamCoder();
    int streamIndex = stream.getIndex();
    SourceDataLine line = mAudioLines.get(streamIndex);
    if (line == null)
    {
      try
      {
        // estabish the audio format, NOTE: xuggler defaults to signed 16 bit
        // samples

        AudioFormat audioFormat = new AudioFormat(audioCoder.getSampleRate(),
          (int) IAudioSamples
          .findSampleBitDepth(audioCoder.getSampleFormat()), audioCoder
          .getChannels(), true, false);
       
        // create the audio line out
       
        DataLine.Info info = new DataLine.Info(SourceDataLine.class,
            audioFormat);
        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

Related Classes of javax.sound.sampled.SourceDataLine

Copyright © 2018 www.massapicom. 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.