Package net.javazoom.jl.player

Examples of net.javazoom.jl.player.AudioDevice


    }

//    if (!ret)
    {
      // last frame, ensure all data flushed to the audio device.
      AudioDevice out = audio;
      if (out != null)
      {
//        System.out.println(audio.getPosition());
        out.flush();
//        System.out.println(audio.getPosition());
        synchronized (this)
        {
          complete = (!closed);
          close();
View Full Code Here


   * Cloases this player. Any audio currently playing is stopped
   * immediately.
   */
  public synchronized void close()
  {
    AudioDevice out = audio;
    if (out != null)
    {
      closed = true;
      audio = null;
      // this may fail, so ensure object state is set up before
      // calling this method.
      out.close();
      lastPosition = out.getPosition();
      try
      {
        bitstream.close();
      }
      catch (BitstreamException ex)
View Full Code Here

   */
  protected boolean decodeFrame() throws JavaLayerException
  {
    try
    {
      AudioDevice out = audio;
      if (out == null) return false;

      Header h = bitstream.readFrame();
      if (h == null) return false;

      // sample buffer set when decoder constructed
      SampleBuffer output = (SampleBuffer) decoder.decodeFrame(h, bitstream);

      synchronized (this)
      {
        out = audio;
        if(out != null)
        {
          out.write(output.getBuffer(), 0, output.getBufferLength());
        }
      }

      bitstream.closeFrame();
    }
View Full Code Here

TOP

Related Classes of net.javazoom.jl.player.AudioDevice

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.