这里录音有两种途径(其实只有一种,可看成是两种而已)。一种是通过标准的<record/>进行录音,另一种是利用<filed>。
第一种方式比较标准,需要发出beep的声音之后才开始录音
第二种方式是filed有name属性,且有option选项(也可以是gramer),因此最后的值是option的值(这目前是猜测,还没有进行完整的测试)
下面的例子来源于:http://www.optimsys.cz/support/examples/example13.php
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<meta name="description" content="record example"/>
<meta name="author" content="OptimSys, s.r.o., Czech Republic (http://www.optimsys.cz)"/>
<meta name="copyright" content="free for any purpose"/>
<form id="start">
<catch event="error.unsupported.record">
<prompt>Recording is not supported in the current configuration, no
audio source specified.</prompt>
<exit/>
</catch>
<record name="recording" maxtime="10s" finalsilence="1s" beep="true">
<noinput> nothing was recoreded </noinput>
Recording starts after beep
<filled>You recorded: <audio expr="recording"/></filled>
</record>
<field name="answer">
<noinput> Hey, don't sleep! </noinput>
<nomatch> say 'yes' or 'no' </nomatch>
<prompt> Do you want to present details about the recording? </prompt>
<grammar root="main" tag-format="semantics/1.0-literals">
<rule id="main" scope="public">
<one-of>
<item><ruleref uri="#yes"/><tag>yes</tag></item>
<item><ruleref uri="#no"/><tag>no</tag></item>
</one-of>
</rule>
<rule id="yes">
<one-of>
<item>yes</item>
<item>yeah</item>
<item>yep</item>
<item>sure</item>
</one-of>
</rule>
<rule id="no">
<one-of>
<item>no</item>
<item>not</item>
<item>nope</item>
</one-of>
</rule>
</grammar>
<filled>
<if cond="answer!='yes'">
OK, good bye.
<exit/>
</if>
</filled>
</field>
<block>
<prompt>Recording size is <value expr="recording$.size"/> bytes.</prompt>
<prompt>Recording duration is <value expr="recording$.duration"/> milliseconds.</prompt>
<if cond="recording$.termchar !== undefined">
<prompt>Recording was interrupted by DTMF key <value expr="recording$.termchar"/>.</prompt>
<elseif cond="recording$.maxtime"/>
Recording was interrupted since it exceeded time limit.
<else/>
Recording was finished without any interruption.
</if>
</block>
</form>
</vxml>
分享到:
相关推荐
本文简要描述了VoiceXML规范及主要术语,给出了一个基于VoiceXML的语音与数据集成模型。该模型通过VoiceXML解释器和浏览器访问Internet上的VoiceXML文档及数据库,从而实现语音和数据的集成,达到了语音浏览的目标。...
用户可免费注册,免费用VoiceXML开发测试自定义融合通信应用系统,为企业用户拥有强大的融合通信系统提供可能。 详细出处参考:http://www.ctiforum.com/factory/f03_04/www.vopromote.com/vopromote09_0201.htm
VoiceXML 教程【最新】 VoiceXML 教程【最新】 VoiceXML 教程【最新】 VoiceXML 教程【最新】
4.1 VoiceXML简介 3 4.2 VoiceXML的背景 4 4.2.1 VoiceXML的结构模型 4 4.2.2 VoiceXML的设计目标 5 4.2.3 VoiceXML的范围 6 4.2.4 VoiceXML的设计要点 7 4.2.5 对VoiceXML实现平台的要求 7 4.3 VoiceXML的一些概念 ...
VoiceXML语音浏览器的研究.VoiceXML语音浏览器的研究.VoiceXML语音浏览器的研究.
VoiceXML 语言解释器的设计与实现
VoiceXml 2.0 开发培训
voicexml的帮助文挡. 其中有很多voicexml程序的例子,对语法有详细的介绍.
在 Java Web 开发框架中创建 VoiceXML 页面
VoiceXML支持多方通信的研究,王文林,廖建新,VoiceXML主要针对语音浏览器而设计, 所以没有提供对多方通信控制的能力. 在分析了多方通信业务所需要的能力的基础上, 利用VoiceXML的objec
是一门关于xml的开发案~~~~应用于语言开发
libsvm-java-kernel.zip,这个项目是libsvm的一个分支,是github上的一个名为libsvm java kernel的项目。它的目标是促进java中树内核方法的开发。它修改了libsvm的java实现以允许通用实例类型,这样内核可以是树内核...
ICD VoiceXML2.1 开发指南 (V300R006_04)ICD VoiceXML2.1 开发指南 (V300R006_04)
1. VoiceXML基础教程 2. VoiceXML高级编程 3. VoiceXML编写手册 4. VoiceXML2.0规范
详细介绍VoiceXML技术,IVR自动业务开发
Voxeo Prophecy平台开发VoiceXML应用
VoiceXML开发指南.doc
用Eclipse开发VoiceXML简要教程
VoiceXML开发的指南.doc
SIP-VoiceXML浏览器的设计与研究