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


Python Tropo.setVoice方法代码示例

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


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

示例1: index

# 需要导入模块: from tropo import Tropo [as 别名]
# 或者: from tropo.Tropo import setVoice [as 别名]
def index(request):
    s = Session(request.body)
    t = Tropo()
    t.setVoice('dave')
    # we use what has been set in Tropo object
    t.say(['hello world!'])
    # we use what is set in the method call
    t.say(['hello world!'], voice="allison")

    # we use the voice that has been set in Tropo object
    choices = Choices("[5 digits]").obj
    t.ask(choices,
              say="Please enter your 5 digit zip code.",
              attempts=3, bargein=True, name="zip", timeout=5)

    # we use the voice passed in the method call.
    choices = Choices("[5 digits]").obj
    t.ask(choices,
              say="Please enter your 5 digit zip code.",
              attempts=3, bargein=True, name="zip", timeout=5, voice="allison")


    json = t.RenderJson()
    print json
    return json
开发者ID:BSierakowski,项目名称:tropo-webapi-python,代码行数:27,代码来源:gh-12-test_voice.py


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