本文整理汇总了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