javazoom.jl.player.Player.play C# (CSharp) 메소드

play() 공개 메소드

Plays a number of MPEG audio frames.
public play ( int frames ) : bool
frames int
리턴 bool
        public virtual bool play(int frames)
        {
            bool ret = true;

            while (frames-- > 0 && ret)
            {
                ret = decodeFrame();
            }

            if (!ret)
            {
                // last frame, ensure all data flushed to the audio device.
                AudioDevice out_Renamed = audio;
                if (out_Renamed != null)
                {
                    out_Renamed.flush();
                    lock (this)
                    {
                        complete = (!closed);
                        close();
                    }
                }
            }
            return ret;
        }

Same methods

Player::play ( ) : void

Usage Example

예제 #1
0
파일: jlp.cs 프로젝트: rejc2/utils
 public virtual void  play()
 {
     try
     {
         System.Console.Out.WriteLine("playing " + fFilename + "...");
         System.IO.Stream in_Renamed = null;
         if (remote == true)
         {
             in_Renamed = URLInputStream;
         }
         else
         {
             in_Renamed = InputStream;
         }
         AudioDevice dev    = AudioDevice;
         Player      player = new Player(in_Renamed, dev);
         player.play();
     }
     catch (System.IO.IOException ex)
     {
         throw new JavaLayerException("Problem playing file " + fFilename, ex);
     }
     catch (System.Exception ex)
     {
         throw new JavaLayerException("Problem playing file " + fFilename, ex);
     }
 }
All Usage Examples Of javazoom.jl.player.Player::play