在系统说些什么时,如何防止用户输入Twilio的语音?
我有一个<Say> Some long text</Say>
,此后应该有来自用户的语音输入。但是,当用户在系统阅读长文本时讲话时,阅读会中断。我需要用户一直听完文本,然后才可以进行语音输入。
有可能在Twilio做吗?
这是我发回的XML响应:
`<Response>
<Gather input="speech" action="MyControllername/MyMethodName" speechTimeout="auto">
<Say>Here is my very long confidential text</Say>
</Gather>
<Redirect>/MyControllername/IncorrectOrNoInputMethod</Redirect>
</Response>
`
这是代码:
`public async Task<TwiMLResult> MyMethodName()
{
var response = new VoiceResponse();
var message = await _logic.GetMyLongText(); // This test I get from BL, it is an async method
var gather = new Gather(new [] {Gather.InputEnum.Speech}.ToList(), Url.ActionUri(nameof(AnotherMethodName), ControllerName), speechTimeout: "auto");
gather.Append(new Say(message));
response.Append(gather);
response.Redirect(Url.ActionUri(nameof(IncorrectOrNoInputMethod), ControllerName));
return TwilioResultFrom(response);
}`
答案 0 :(得分:1)
这里是Twilio的传播者。
您需要在聚会前使用说动词:
<?php query_posts('cat=8&posts_per_page=3'); while (have_posts()) : the_post(); ?>
<div>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<a href="<?php the_permalink(); ?>"><img src="<?php echo $image[0]; ?>" class="card-img img-responsive"></a>
<p class="feature-card-head"><?php the_title(); ?></p>
<p class="feature-card-txt"><?php echo get_the_excerpt(); ?></p>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
因此,在C#中,您只需直接在<Response>
<Say>Here is my very long confidential text</Say>
<Gather input="speech" action="MyControllername/MyMethodName" speechTimeout="auto">
</Gather>
<Redirect>/MyControllername/IncorrectOrNoInputMethod</Redirect>
</Response>
对象上调用Say
方法,然后将其附加到response
:
gather
希望有帮助。