Examples of ProcessException


Examples of com.stimulus.archiva.exception.ProcessException

     */ 

    public void processMessages(ProcessMessage process ) throws ProcessException
    {
        if (process==null)
            throw new ProcessException("assertion failure: null procress",logger);
        Iterator v = process.volumes.iterator();
        process.totalSize = 0;
        process.totalFileCount = 0;
        FileFilter filter = new MessageStore.MessageFileFilter(new String[] {".",messageFileExtension});

View Full Code Here

Examples of com.sun.speech.freetts.ProcessException

        // 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.ProcessException

        // Open Mbrola
        Process process;
        try {
            process = Runtime.getRuntime().exec(cmd);
        } catch (Exception e) {
            throw new ProcessException("Cannot start mbrola program: " + cmd);
        }
        PrintWriter toMbrola = new PrintWriter(process.getOutputStream());
        BufferedInputStream fromMbrola =
            new BufferedInputStream(process.getInputStream());

        while (segment != null) {
            String name = segment.getFeatures().getString("name");
            // Individual duration of segment, in milliseconds:
            int dur = segment.getFeatures().getInt("mbr_dur");
            // List of time-f0 targets. In each target, the first value
            // indicates where on the time axis the target is reached,
            // expressed in percent of segment duration; the second value in
            // each pair is f0, in Hz.
            String targets = segment.getFeatures().getString("mbr_targets");
            String output = (name + " " + dur + " " + targets);
            // System.out.println(output);
            toMbrola.println(output);
            segment = segment.getNext();
        }

        toMbrola.flush();

        // BUG:
        // There is a  bug that causes the final 'close' on a stream
        // going to a sub-process to not be seen by the sub-process on
        // occasion. This seems to occur mainly when the close occurs
        // very soon after the creation and writing of data to the
        // sub-process.  This delay can help work around the problem
        // If we delay before the close by
        // a small amount (100ms), the hang is averted.  This is a WORKAROUND
        // only and should be removed once the bug in the 'exec' is
        //  fixed.  We get the delay from the property:
        //
        // de.dfki.lt.freetts.mbrola.MbrolaCaller.closeDelay,
        //

        if (closeDelay > 0l) {
            try {
                Thread.sleep(closeDelay);
            } catch (InterruptedException ie) {
            }
        }
        toMbrola.close();
     
        // reading the audio output
        byte[] buffer = new byte[1024];
       
        // In order to avoid resizing a large array, we save the audio data
        // in the chunks in which we read it.

        List audioData = new java.util.ArrayList();
        int totalSize = 0;
        int nrRead = -1; // -1 means end of file

        try {
            while ((nrRead = fromMbrola.read(buffer)) != -1) {
                if (nrRead < buffer.length) {
                    byte[] slice = new byte[nrRead];
                    System.arraycopy(buffer, 0, slice, 0, nrRead);
                    audioData.add(slice);
                } else {
                    audioData.add(buffer);
                    buffer = new byte[buffer.length];
                }
                totalSize += nrRead;
            }
            fromMbrola.close();
        } catch (IOException e) {
            throw new ProcessException("Cannot read from mbrola");
        }

        if (totalSize == 0) {
            throw new ProcessException("No audio data read");
        }

        utterance.setObject("mbrolaAudio", audioData);
        utterance.setInt("mbrolaAudioLength", totalSize);
    }
View Full Code Here

Examples of com.sun.speech.freetts.ProcessException

  if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.fine("=== " +
    utterance.getString("input_text"));
  }
  if (!lpcResult.playWave(audioPlayer, utterance)) {
      throw new ProcessException("Output Cancelled");
  }
    }
View Full Code Here

Examples of net.sourceforge.jwbf.core.actions.util.ProcessException

      log.error(e.getClass().getName() + e.getLocalizedMessage());
    } catch (IOException e) {
      log.error(e.getClass().getName() + e.getLocalizedMessage());
    } catch (NullPointerException e) {
      log.error(e.getClass().getName() + e.getLocalizedMessage());
      throw new ProcessException("No regular content was found, check your api\n::" + s);
    } catch (Exception e) {
      log.error(e.getClass().getName() + e.getLocalizedMessage());
      throw new ProcessException(e.getLocalizedMessage());
    }


    return s;
  }
View Full Code Here

Examples of net.sourceforge.jwbf.core.actions.util.ProcessException

    } else if (result.equalsIgnoreCase(needToken) && reTryLimit ) {
      msg = getLoginMsg(username, pw, domain, loginEl.getAttributeValue("token"));
      reTry = true;
      reTryLimit = false;
    } else if (result.equalsIgnoreCase(wrongPass)) {
      throw new ProcessException("Wrong Password");
    } else if (result.equalsIgnoreCase(notExists)) {
      throw new ProcessException("No such User");
    }

  }
View Full Code Here

Examples of net.sourceforge.jwbf.core.actions.util.ProcessException

    if (title == null || title.length() == 0) {
      throw new IllegalArgumentException("The argument 'title' must not be null or empty");
    }

    if (!bot.getUserinfo().getRights().contains("delete")) {
      throw new ProcessException(
          "The given user doesn't have the rights to delete. "
          + "Add '$wgGroupPermissions['bot']['delete'] = true;' "
          + "to your MediaWiki's LocalSettings.php might solve this problem.");
    }
View Full Code Here

Examples of net.sourceforge.jwbf.core.actions.util.ProcessException

   * @param articlename a
   * @throws ProcessException if arcticlename is empty
   */
  public GetRevision(final String articlename) throws ProcessException {
    if (articlename.length() <= 0) {
      throw new ProcessException("articlename is empty");
    }
    sa = new SimpleArticle();
    sa.setTitle(articlename);

   
View Full Code Here

Examples of net.sourceforge.jwbf.core.actions.util.ProcessException

      while (m.find()) {
        lastP = MediaWiki.decode(m.group(1));
        LOG.error("Upload failed: " + lastP);
      }

      throw new ProcessException("Upload failed - " + lastP);
    }
    return "";
  }
View Full Code Here

Examples of net.sourceforge.jwbf.core.actions.util.ProcessException

   * @param articlename a
   * @throws ProcessException if arcticlename is empty
   */
  public GetRevision(final String articlename) throws ProcessException {
    if (articlename.length() <= 0) {
      throw new ProcessException("articlename is empty");
    }
    sa = new SimpleArticle();
    sa.setTitle(articlename);

   
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.