Examples of VoiceManager


Examples of com.sun.mpk20.voicelib.app.VoiceManager

    private PresenceInfo[] getChatters(String group) {
  return getChatters(group, null);
    }

    private PresenceInfo[] getChatters(String group, ChatType chatType) {
  VoiceManager vm = AppContext.getManager(VoiceManager.class);

  AudioGroup audioGroup = vm.getAudioGroup(group);

  if (audioGroup == null) {
      logger.fine("Can't find audio group " + group);
      return null;
  }

  AudioGroup livePlayerAudioGroup = vm.getVoiceManagerParameters().livePlayerAudioGroup;

        AudioGroup stationaryPlayerAudioGroup = vm.getVoiceManagerParameters().stationaryPlayerAudioGroup;

  if (audioGroup.equals(livePlayerAudioGroup) || audioGroup.equals(stationaryPlayerAudioGroup)) {
      return null;
  }
View Full Code Here

Examples of com.sun.mpk20.voicelib.app.VoiceManager

    }

    public void dialOut(final WonderlandClientSender sender,
      final WonderlandClientID clientID, final VoiceChatDialOutMessage message) {

  VoiceManager vm = AppContext.getManager(VoiceManager.class);

  String group = message.getGroup();

  PresenceInfo callee = message.getCallee();

  String externalCallID = group + "-" + callNumber++;

        callee = new PresenceInfo(callee.getCellID(), callee.getClientID(),
                                  callee.getUserID(), externalCallID);

  String softphoneCallID = message.getSoftphoneCallID();

  Call softphoneCall = vm.getCall(softphoneCallID);

  Player softphonePlayer = null;

  if (softphoneCall != null) {
      softphonePlayer = softphoneCall.getPlayer();
  }
       
   if (softphonePlayer == null) {
      logger.warning("Softphone player is not connected!");
            sender.send(clientID, new VoiceChatCallEndedMessage(
          group, callee, "Softphone is not connected!"));
      return;
  }

  logger.fine("EXTERNAL CALLID IS " + externalCallID + " "
      + " softphone callID " + softphoneCallID + " softphone call "
      + softphoneCall + " softphone player " + softphonePlayer);

  logger.fine("Got place call message " + externalCallID);

  PlayerSetup playerSetup = new PlayerSetup();
  playerSetup.x = softphonePlayer.getX();
  playerSetup.y = 1.5;
  playerSetup.z = softphonePlayer.getZ();
  playerSetup.isOutworlder = true;
  playerSetup.isLivePlayer = true;

  CallSetup setup = new CallSetup();
 
  setup.externalOutgoingCall = true;

  CallParticipant cp = new CallParticipant();

  setup.cp = cp;

  try {
      setup.bridgeInfo = vm.getVoiceBridge();
  } catch (IOException e) {
      logger.warning("Unable to get voice bridge for call " + cp + ":  "
    + e.getMessage());
            sender.send(clientID, new VoiceChatCallEndedMessage(
          group, callee, "No voice bridge available!"));
      return;
  }

  AudioGroup audioGroup = vm.getAudioGroup(group);

  if (audioGroup == null) {
      logger.warning("No audio group " + group);
            sender.send(clientID, new VoiceChatCallEndedMessage(
          group, callee, "Audio group not found!"));
      return;
  }

  cp.setPhoneNumber(message.getPhoneNumber());
  cp.setName(callee.getUsernameAlias());
  cp.setCallId(externalCallID);
  cp.setConferenceId(vm.getVoiceManagerParameters().conferenceId);
  cp.setVoiceDetection(true);
  cp.setDtmfDetection(true);
  cp.setVoiceDetectionWhileMuted(true);
  cp.setHandleSessionProgress(true);

  new VoiceChatPhoneStatusListener(group, callee, externalCallID, clientID);
 
  Call externalCall;

  try {
            externalCall = vm.createCall(externalCallID, setup);
  } catch (IOException e) {
      logger.warning("Unable to create call " + cp + ":  "
    + e.getMessage());
            sender.send(clientID, new VoiceChatCallEndedMessage(
          group, callee, "Can't create call!"));
      return;
  }

  Player externalPlayer = vm.createPlayer(externalCallID, playerSetup);

  externalCall.setPlayer(externalPlayer);

  externalPlayer.setCall(externalCall);
View Full Code Here

Examples of com.sun.speech.freetts.VoiceManager

 
  public Voice getVoice() {
    System.setProperty("freetts.voices","com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
    if(this.voice == null) {
          VoiceManager voiceManager = VoiceManager.getInstance();
      Voice helloVoice = voiceManager.getVoice("kevin16");
      if (helloVoice == null) {
        System.err.println("Cannot find voices");
        for(Voice voice : voiceManager.getVoices()) {
          System.out.println("Voice: " + voice.getName());
        }
      }
      helloVoice.allocate();
      this.voice = helloVoice;
View Full Code Here

Examples of com.sun.speech.freetts.VoiceManager

            } else {
                //use default basic voices
                System.setProperty("freetts.voices", "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
                voice = VoiceManager.getInstance().getVoice(Utilities.getProperty("voice16kName", "kevin16"));
            }
            VoiceManager voiceManager = VoiceManager.getInstance();
            Voice[] voices = voiceManager.getVoices();
            if (voices.length <= 0) {
                Freedomotic.logger.severe("Cannot use text to speech, no voice found");
                setDescription("Cannot use text to speech, no voice found");
                stop();
            } else {
View Full Code Here

Examples of com.sun.speech.freetts.VoiceManager

     * Example of how to list all the known voices.
     */
    public static void listAllVoices() {
        System.out.println();
        System.out.println("All voices available:");       
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice[] voices = voiceManager.getVoices();
        for (int i = 0; i < voices.length; i++) {
            System.out.println("    " + voices[i].getName()
                               + " (" + voices[i].getDomain() + " domain)");
        }
    }
View Full Code Here

Examples of com.sun.speech.freetts.VoiceManager

        System.out.println();
        System.out.println("Using voice: " + voiceName);
       
        /* The VoiceManager manages all the voices for FreeTTS.
         */
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice helloVoice = voiceManager.getVoice(voiceName);

        if (helloVoice == null) {
            System.err.println(
                "Cannot find a voice named "
                + voiceName + ".  Please specify a different voice.");
View Full Code Here

Examples of com.sun.speech.freetts.VoiceManager

    /**
     * Creates and loads the Voice.
     */
    private void createVoice(String voiceName) {
        VoiceManager voiceManager = VoiceManager.getInstance();
        emacsVoice = voiceManager.getVoice(voiceName);
        if (emacsVoice == null) {
            System.err.println("No such voice with the name: " + voiceName);
            System.exit(1);
        }
        emacsVoice.allocate();
View Full Code Here

Examples of com.sun.speech.freetts.VoiceManager

     * by default.
     */
    public Server() {
  port = Utilities.getInteger("port", 5555).intValue();
  try {
            VoiceManager voiceManager = VoiceManager.getInstance();
      voice8k = voiceManager.getVoice(voice8kName);
      voice16k = voiceManager.getVoice(voice16kName);
            voice8k.allocate();
            voice16k.allocate();
  } catch (Exception e) {
      e.printStackTrace();
      System.exit(1);
View Full Code Here

Examples of com.sun.speech.freetts.VoiceManager

    }

    public static void listAllVoices() {
        System.out.println();
        System.out.println("All voices available:");
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice voices[] = voiceManager.getVoices();
        for (int i = 0; i < voices.length; i++)
            System.out.println("    " + voices[i].getName() + " (" + voices[i].getDomain() + " domain)");

    }
View Full Code Here

Examples of com.sun.speech.freetts.VoiceManager

    }

    public static void main(String args[]) {
        listAllVoices();
        System.out.println();
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice helloVoice = voiceManager.getVoice("kevin16");
        if (helloVoice == null) {
            System.exit(1);
        }
        helloVoice.allocate();
        helloVoice.speak("all over the world, you can see");
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.