Package javazoom.jl.player.advanced

Examples of javazoom.jl.player.advanced.AdvancedPlayer


        BufferedInputStream bis = null;
        try {
          bis = new BufferedInputStream(new FileInputStream(file), FILE_BUFFER_SIZE);

          try {
            player = new AdvancedPlayer(bis);
            player.setPlayBackListener(new PlaybackListener() {
              @Override
              public void playbackStarted(final PlaybackEvent playbackevent) {

                isRunning = true;
View Full Code Here


    public boolean setTrack(String trackTitle) {
        try {
            input = this.getClass().getResourceAsStream(playList.getPath(trackTitle));
            BufferedInputStream in = new BufferedInputStream(this.input);
            device = FactoryRegistry.systemRegistry().createAudioDevice();
            this.player = new AdvancedPlayer(in, device);
        } catch (JavaLayerException ex) {
            Logger.getLogger(MPmitMP3.class.getName()).log(Level.SEVERE, null, ex);
            return false;
        }
        return true;
View Full Code Here

    public boolean setTrack(String trackTitle) {
        try {
            in = this.getClass().getResourceAsStream(pl.getPath(trackTitle));
            BufferedInputStream in = new BufferedInputStream(this.in);
            device = FactoryRegistry.systemRegistry().createAudioDevice();
            this.p = new AdvancedPlayer(in, device);
        } catch (JavaLayerException ex) {
            Logger.getLogger(MPmitMP3.class.getName()).log(Level.SEVERE, null, ex);
            return false;
        }
        return true;
View Full Code Here

    }
    if(i < files.size()) {
      fCurrent = new File(files.get(i).getFilename());
      fisAudioFile = new FileInputStream(fCurrent);
      playing = true;
      p1 = new AdvancedPlayer(fisAudioFile);
      p1.setVolume(1);
      p1.setPlayBackListener(playback);
      p1.setAmplitudeListener(new AmplitudeListener() {
       
        @Override
        public void getAmplitude(short amplitude) {
          byte bamp = 0;
          if(amplitude < 10 && amplitude >= 0) {
            bamp = 0;
          } else if(amplitude < 6400) {
            bamp = 1;
          } else if(amplitude < 12800) {
            bamp = 2;
          } else if(amplitude < 19200) {
            bamp = 3;
          } else if(amplitude < 25600) {
            bamp = 4;
          } else if(amplitude < 32000) {
            bamp = 5;
          } else {
            bamp = 6;
          }
          if(bamp != memAmp) {
            if(ampChange != null) {
              ampChange.amplitudeChange(bamp);
            }
            memAmp = bamp;
          }
        }
      });
      thPlay = new Thread(player);
      thPlay.start();
     
      thSlide = new Thread(slide);
      thSlide.start();
      if(i != currFile) {
        currFile = i;
      }
      if(playChange != null) {
        playChange.changePlay(i, files.get(currFile).getFilename() ,true);
      }
      if(playChangeNetwork != null) {
        playChangeNetwork.changePlay(currFile, files.get(currFile).getFilename(), true,
            currPosition, max_frames);
      }
      return files.get(i).getFilename();
    } else if(repeat == true) {
      currFile = 0;
      fCurrent = new File(files.get(i).getFilename());
      FileInputStream fis = new FileInputStream(fCurrent);
      playing = true;
      p1 = new AdvancedPlayer(fis, audio);
      p1.setPlayBackListener(playback);
      thPlay = new Thread(player);
      thPlay.start();
      thSlide = new Thread(slide);
      thSlide.start();
View Full Code Here

     * Creer un nouveau lecteur avec la musique passée en parametre
     * @param musiquePath
     */
    public AudioPlayer(final String musiquePath) {
        try {
            player = new AdvancedPlayer(new FileInputStream(musiquePath));
        } catch (FileNotFoundException ex) {
            Logger.getLogger(AudioPlayer.class.getName()).log(Level.SEVERE, null, ex);
        } catch (JavaLayerException ex) {
            Logger.getLogger(AudioPlayer.class.getName()).log(Level.SEVERE, null, ex);
        }
View Full Code Here

TOP

Related Classes of javazoom.jl.player.advanced.AdvancedPlayer

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.