Examples of AudioPlayer


Examples of Adaptor.AudioPlayer

   
    System.out.println("ADAPTOR DEMO");
    System.out.println();
   
    //instantiate the audio player
    AudioPlayer ap = new AudioPlayer();
   
    //Test out the examples
    ap.play("mp3", "Sub Focus - Turn Back Time");
    ap.play("flac", "Paul Van Dyk - For An Angel");
    ap.play("ogg", "Ellie Goulding - Starry Eyed");
    ap.play("wav", "Robin Thicke - Blurred Lines");
    ap.play("wma", "Storm Queen - Look Right Through");
   
    System.out.println();
   
 
View Full Code Here

Examples of audiovideoplayer.model.AudioPlayer

                                        File selected = (File) fileList.getSelectedValue();
                                        if (selected.isDirectory()) {
                                                setListData(selected);
                                        }
                                        if (selected.getName().endsWith(".mp3")) {
                                                new AudioPlayer(selected).play();
                                        }
                                }
                        }
                        public void mousePressed(MouseEvent event) {
                                if (MouseEvent.BUTTON2 == event.getButton()) {
View Full Code Here

Examples of com.sun.speech.freetts.audio.AudioPlayer

        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("=== " +
                                 utterance.getString("input_text"));
        }

        AudioPlayer audioPlayer = utterance.getVoice().getAudioPlayer();

  audioPlayer.setAudioFormat(MBROLA_AUDIO);
  audioPlayer.setVolume(utterance.getVoice().getVolume());

        // The AudioPlayer interface currently does not allow streaming audio.
        // We need to know the total number of samples that will be written
        // before we can start writing them. Therefore, we need to load all
        // audio data for this utterance into RAM.
       
        List audioData = (List) utterance.getObject("mbrolaAudio");
        if (audioData == null) {
            throw new ProcessException
                ("No \"mbrolaAudio\" object is associated with utterance");
        }

        // total number of audio bytes

        int totalSize;
        try {
            totalSize = utterance.getInt("mbrolaAudioLength");
        } catch (NullPointerException npe) {
            totalSize = 0;
        }

        audioPlayer.begin(totalSize);

        for (Iterator it = audioData.iterator(); it.hasNext();) {
            byte[] bytes = (byte[]) it.next();
            if (!audioPlayer.write(bytes)) {
                throw new ProcessException
                    ("Cannot write audio data to audio player");
            }
        }

        if (!audioPlayer.end()) {
            throw new ProcessException("audio player reports problem");
        }
    }
View Full Code Here

Examples of com.sun.speech.freetts.audio.AudioPlayer

     */
    public void processUtterance(Utterance utterance) throws ProcessException {
  LPCResult lpcResult = (LPCResult) utterance.getObject("target_lpcres");
  SampleInfo sampleInfo =
      (SampleInfo) utterance.getObject(SampleInfo.UTT_NAME);
  AudioPlayer audioPlayer = utterance.getVoice().getAudioPlayer();

  audioPlayer.setAudioFormat(getAudioFormat(sampleInfo));
  audioPlayer.setVolume(utterance.getVoice().getVolume());

  if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.fine("=== " +
    utterance.getString("input_text"));
  }
View Full Code Here

Examples of game.audioPlayer.AudioPlayer

     * @param guiModel
     */
    public TitleModel(final GUIModel guiModel) {
        Event.setTitleEvent(new TitleEvent(this));
        counter = new Counter();
        audioPlayer = new AudioPlayer(GeneralConstant.MUSIQUE_PATH + "title.mp3");
        audioPlayer.start();
        Collector.signaler(audioPlayer);
        animation = new TitleAnimation();
        Collector.signaler(animation);
        animation.addObserver(this);
View Full Code Here

Examples of huu.phong.musiconline.audio.AudioPlayer

    setSize(1020, 700);
//    setResizable(false);
    setIconImage(toolkit.getImage((object.getResource("/images/zing.png"))));

    configure = Configure.getInstance();
    player = new AudioPlayer();
    player.setListener(new AudioPlayerListener() {
     
      public void playing(AudioPlayer player) {
        startDuration.setText(Utils.toDuaration(player.getCurrentDuration()));
        if (!slider.dragging) slider.setValue(player.getCurrentSize());
View Full Code Here

Examples of marytts.util.data.audio.AudioPlayer

      // LocalMaryInterface.setAudioFileFormatForVoice() method is called. After that we can set the voice, otherwise an NPE occurs
      marytts.setLocale(voice.getLocale());
      marytts.setVoice(voice.getName());
      try {
        AudioInputStream audio = marytts.generateAudio(text);
        AudioPlayer player = new AudioPlayer(audio);
        player.start();
        player.join();
       
      } catch (SynthesisException e) {
        logger.error("Error during tts generation: {}", e.getLocalizedMessage(), e);
      } catch (InterruptedException e) {
        logger.error("Error during tts playback: {}", e.getLocalizedMessage(), e);
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.