当前位置: 首页>>代码示例>>Java>>正文


Java Reprompt.setOutputSpeech方法代码示例

本文整理汇总了Java中com.amazon.speech.ui.Reprompt.setOutputSpeech方法的典型用法代码示例。如果您正苦于以下问题:Java Reprompt.setOutputSpeech方法的具体用法?Java Reprompt.setOutputSpeech怎么用?Java Reprompt.setOutputSpeech使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazon.speech.ui.Reprompt的用法示例。


在下文中一共展示了Reprompt.setOutputSpeech方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getWelcomeResponse

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
/**
 * Creates and returns a {@code SpeechletResponse} with a welcome message.
 *
 * @return SpeechletResponse spoken and visual response for the given intent
 */
private SpeechletResponse getWelcomeResponse() {
    String speechText = "Welcome to the Alexa Skills Kit, you can say hello";

    // Create the Simple card content.
    SimpleCard card = new SimpleCard();
    card.setTitle("HelloWorld");
    card.setContent(speechText);

    // Create the plain text output.
    PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
    speech.setText(speechText);

    // Create reprompt
    Reprompt reprompt = new Reprompt();
    reprompt.setOutputSpeech(speech);

    return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
 
开发者ID:arun-gupta,项目名称:alexa-skill-java,代码行数:24,代码来源:HelloWorldSpeechlet.java

示例2: getHelpResponse

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
/**
 * Creates a {@code SpeechletResponse} for the help intent.
 *
 * @return SpeechletResponse spoken and visual response for the given intent
 */
private SpeechletResponse getHelpResponse() {
    String speechText = "You can say hello to me!";

    // Create the Simple card content.
    SimpleCard card = new SimpleCard();
    card.setTitle("HelloWorld");
    card.setContent(speechText);

    // Create the plain text output.
    PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
    speech.setText(speechText);

    // Create reprompt
    Reprompt reprompt = new Reprompt();
    reprompt.setOutputSpeech(speech);

    return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
 
开发者ID:arun-gupta,项目名称:alexa-skill-java,代码行数:24,代码来源:HelloWorldSpeechlet.java

示例3: getWelcomeResponse

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
/**
 * Creates and returns a {@code SpeechletResponse} with a welcome message.
 *
 * @return SpeechletResponse spoken and visual response for the given intent
 */
@OnLaunch
public SpeechletResponse getWelcomeResponse() {
  String speechText = "Welcome to the Alexa Skills Kit, you can say hello";

  // Create the Simple card content.
  SimpleCard card = new SimpleCard();
  card.setTitle("HelloWorld");
  card.setContent(speechText);

  // Create the plain text output.
  PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
  speech.setText(speechText);

  // Create reprompt
  Reprompt reprompt = new Reprompt();
  reprompt.setOutputSpeech(speech);

  return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
 
开发者ID:rainu,项目名称:alexa-skill,代码行数:25,代码来源:HelloWorldSpeechlet.java

示例4: getHelpResponse

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
/**
 * Creates a {@code SpeechletResponse} for the help intent.
 *
 * @return SpeechletResponse spoken and visual response for the given intent
 */
@OnIntent({ "AMAZON.HelpIntent", "AMAZON.StopIntent", "AMAZON.CancelIntent" })
public SpeechletResponse getHelpResponse() {
  String speechText = "You can say hello to me!";

  // Create the Simple card content.
  SimpleCard card = new SimpleCard();
  card.setTitle("HelloWorld");
  card.setContent(speechText);

  // Create the plain text output.
  PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
  speech.setText(speechText);

  // Create reprompt
  Reprompt reprompt = new Reprompt();
  reprompt.setOutputSpeech(speech);

  return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
 
开发者ID:rainu,项目名称:alexa-skill,代码行数:25,代码来源:HelloWorldSpeechlet.java

示例5: getReprompt

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
/**
 * Gets the generated reprompt.
 * @return the generated reprompt
 */
@Override
public Reprompt getReprompt() {
    if (reprompt != null || !output.shouldReprompt()) {
        return reprompt;
    }

    final String repromptSpeech = yamlReader.getRandomReprompt(output).orElse(null);

    if (repromptSpeech != null) {
        final String utteranceSsml = resolveSlotsInUtterance(repromptSpeech);
        final SsmlOutputSpeech ssmlOutputSpeech = new SsmlOutputSpeech();
        ssmlOutputSpeech.setSsml(utteranceSsml);
        final Reprompt reprompt2 = new Reprompt();
        reprompt2.setOutputSpeech(ssmlOutputSpeech);
        return reprompt2;
    }
    return null;
}
 
开发者ID:KayLerch,项目名称:alexa-skills-kit-tellask-java,代码行数:23,代码来源:AlexaSpeechletResponse.java

示例6: onLaunch

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
@Override
public SpeechletResponse onLaunch(LaunchRequest request, Session session) throws SpeechletException {
    String speechText = "Hello world, this is Snoolexa! Try asking for hot posts!";

    //TODO: Query the me endpoint and tell asker about currently signed in redditor and any notifications

    // Create the Simple card content.
    SimpleCard card = new SimpleCard();
    card.setTitle("Snoolexa");
    card.setContent(speechText);

    // Create the plain text output.
    PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
    speech.setText(speechText);

    // Create reprompt
    Reprompt reprompt = new Reprompt();
    reprompt.setOutputSpeech(speech);

    return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
 
开发者ID:winterton,项目名称:snoolexa,代码行数:22,代码来源:SnoolexaSpeechlet.java

示例7: getWelcomeResponse

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
/**
 * Creates and returns a {@code SpeechletResponse} with a welcome message.
 *
 * @return SpeechletResponse spoken and visual response for the given intent
 */
private SpeechletResponse getWelcomeResponse() {
	String speechText = "This is Sky, how can I help you";

	// create the Simple card content
	SimpleCard card = new SimpleCard();
	card.setTitle("Sky");
	card.setContent(speechText);

	// create the plain text output
	PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
	speech.setText(speechText);

	// create reprompt
	Reprompt reprompt = new Reprompt();
	reprompt.setOutputSpeech(speech);

	return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
 
开发者ID:bellissimo,项目名称:AlexaSky,代码行数:24,代码来源:SkySpeechlet.java

示例8: getHelpResponse

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
/**
 * Creates a {@code SpeechletResponse} for the help intent.
 *
 * @return SpeechletResponse spoken and visual response for the given intent
 */
private SpeechletResponse getHelpResponse() {
	String speechText = "I am not a very helpful skill I'm afraid!";

	// Create the Simple card content.
	SimpleCard card = new SimpleCard();
	card.setTitle("Sky");
	card.setContent(speechText);

	// Create the plain text output.
	PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
	speech.setText(speechText);

	// Create reprompt
	Reprompt reprompt = new Reprompt();
	reprompt.setOutputSpeech(speech);

	return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
 
开发者ID:bellissimo,项目名称:AlexaSky,代码行数:24,代码来源:SkySpeechlet.java

示例9: getEpisode

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
private SpeechletResponse getEpisode(String show) {
    log.info("Received request for show '" + show + "'");
    PlainTextOutputSpeech mySpeech = new PlainTextOutputSpeech();
    Random randy = new Random();
    if (showHash.containsKey(show)) {
        int season = randy.nextInt(showHash.get(show).length);
        int episode = randy.nextInt(showHash.get(show)[season]) + 1;
        log.info("Randomly generated season " + season + " and episode " + episode);
        mySpeech.setText("Watch " + show + " season " + (season + 1) + " episode " + episode);
        return SpeechletResponse.newTellResponse(mySpeech);
    } else if ("any show".equals(show)) {
        String tv_show = listOfShows[randy.nextInt(listOfShows.length)];
        return getEpisode(tv_show);
    }
    else if (show.isEmpty()){
        mySpeech.setText("Which show?");
        PlainTextOutputSpeech repromptSpeech = new PlainTextOutputSpeech();
        repromptSpeech.setText("Which show? Choose between " + String.join(", ", Arrays.copyOfRange(listOfShows, 0, listOfShows.length-1)) + " and " + listOfShows[listOfShows.length-1]);
        Reprompt reprompt = new Reprompt();
        reprompt.setOutputSpeech(repromptSpeech);
        return SpeechletResponse.newAskResponse(mySpeech, reprompt);
    }
    else {
        mySpeech.setText("I don't know about that show");
        return SpeechletResponse.newTellResponse(mySpeech);
    }

}
 
开发者ID:seattlesuekim,项目名称:tv-show-randy,代码行数:29,代码来源:RandySpeechlet.java

示例10: getRepromptSpeech

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
public Reprompt getRepromptSpeech() {
    SsmlOutputSpeech outputSpeech = new SsmlOutputSpeech();
    outputSpeech.setSsml("<speak>If you are lost, just ask me to help.</speak>");
    Reprompt reprompt = new Reprompt();
    reprompt.setOutputSpeech(outputSpeech);
    return reprompt;
}
 
开发者ID:KayLerch,项目名称:alexa-morser-coder-skill,代码行数:8,代码来源:AbstractSpeechlet.java

示例11: newAskResponse

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
/**
 * Wrapper for creating the Ask response. The OutputSpeech and {@link Reprompt} objects are
 * created from the input strings.
 *
 * @param stringOutput
 *            the output to be spoken
 * @param repromptText
 *            the reprompt for if the user doesn't reply or is misunderstood.
 * @return SpeechletResponse the speechlet response
 */
private SpeechletResponse newAskResponse(String stringOutput, String repromptText) {
    PlainTextOutputSpeech outputSpeech = new PlainTextOutputSpeech();
    outputSpeech.setText(stringOutput);

    PlainTextOutputSpeech repromptOutputSpeech = new PlainTextOutputSpeech();
    repromptOutputSpeech.setText(repromptText);
    Reprompt reprompt = new Reprompt();
    reprompt.setOutputSpeech(repromptOutputSpeech);

    return SpeechletResponse.newAskResponse(outputSpeech, reprompt);
}
 
开发者ID:beckdac,项目名称:alexa_domoticz_bridge,代码行数:22,代码来源:DomoticzSpeechlet.java

示例12: createWelcomeResponse

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
protected SpeechletResponse createWelcomeResponse() {
    // TODO, register these
    PlainTextOutputSpeech outputSpeech = new PlainTextOutputSpeech();
    outputSpeech.setText("You can tell me someone took medicine or record the time");

    Reprompt reprompt = new Reprompt();
    reprompt.setOutputSpeech(SpeechletUtils.createTextOutputSpeech("What should I note?"));

    return SpeechletResponse.newAskResponse(outputSpeech, reprompt);
}
 
开发者ID:itzg,项目名称:alexa-notes,代码行数:11,代码来源:NoteTakerSpeechlet.java

示例13: ask

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
/**
 * Have Alexa ask something, and reprompt if there was no answer.
 *
 * @param askOutput The initial question without speak tags.
 * @param repromptOutput The reprompt statement without speak tags.
 * @return SpeechletResponse
 */
public static SpeechletResponse ask(String askOutput, String repromptOutput,
    Session session) {
  SsmlOutputSpeech outputSpeech = new SsmlOutputSpeech();
  outputSpeech.setSsml("<speak>" + askOutput + "</speak>");
  SsmlOutputSpeech repromptOutputSpeech = new SsmlOutputSpeech();
  repromptOutputSpeech.setSsml("<speak>" + repromptOutput + "</speak>");
  Reprompt reprompt = new Reprompt();
  reprompt.setOutputSpeech(repromptOutputSpeech);
  return SpeechletResponse.newAskResponse(outputSpeech, reprompt);
}
 
开发者ID:vqtran,项目名称:EchoQuery,代码行数:18,代码来源:Response.java

示例14: withOutputSpeech

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
public static Reprompt withOutputSpeech(OutputSpeech speech){
    Reprompt result = new Reprompt();
    result.setOutputSpeech(speech);
    return result;
}
 
开发者ID:kebernet,项目名称:skillz,代码行数:6,代码来源:RepromptBuilder.java

示例15: repromt

import com.amazon.speech.ui.Reprompt; //导入方法依赖的package包/类
/**
 * Creates a reprompt with the given question.
 *
 * @param question Question.
 * @return Reprompt.
 */
public static Reprompt repromt(String question) {
    Reprompt result = new Reprompt();
    result.setOutputSpeech(speech(question));
    return result;
}
 
开发者ID:qaware,项目名称:iot-hessen-amazon-echo,代码行数:12,代码来源:AlexaHelper.java


注:本文中的com.amazon.speech.ui.Reprompt.setOutputSpeech方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。