|
Author
|
Topic: dtmf and voice detection in parallel
|
tfpet
Junior Member
Member # 3213
|
posted August 11, 2005 09:19 PM
I have a potential application that may work this way: - play announcement/prompt - detect EITHER a recorded phrase (e.g. a person's name), OR a 4-digit PIN number, terminated by a # sign.
How can I do it in VoiceXML? Looks like <record> will not be able to collect a 4-digit PIN for analysis. Using a <field> would require a grammar file, but there is really no grammar for the user name since it is all free format. If I specify dtmf digits grammar, the <field> is not able to input a spoken phrase that are not of digits type. Any help is much appreciated...
Thanks!
-tf
Posts: 3 | Registered: Aug 2005
| IP: Logged
|
|
mheadd
Member
Member # 3181
Member Rated:
|
posted August 12, 2005 11:14 AM
In VoiceXML 2.1, you can record a caller utterance while simultaneously performing a recognition (See http://www.w3.org/TR/2005/CR-voicexml21-20050613/#sec-reco_reco ). The following may be possible, but I haven’t tested it to verify.
First step is to enable audio capture: <property name=”recordutterance” value=”true”/>
(Note -- You may also want to modify the “inputmodes” property to capture DTMF only - this should prevent the VoiceXML platform from trying to make a recognition on spoken input. In other words, if a user tries to enter spoken input for a “digits” field, the platform may attempt to interpret the input as digits. For example, “John Forsay” might be recognized as “940”. Not sure how different platforms will react to spoken input when this change is made, so may want to play round with this a bit.)
If you create a field of type “digits” (i.e., use the digits builtin grammar type -- http://www.w3.org/TR/voicexml20/#dmlABuiltins ), you will be able to capture the four digit PIN number. Then set up a nomatch handler for the field for instances where the caller says a name (or any other spoken input) that can process the captured audio:
<field name=”main” type=”digits?length=4”>
<nomatch cond=”main$.inputmode==’voice’”> <var name=”sayWhat” expr=”application.lastaudio$”/> <data src=”audioCollect.php” namelist=”sayWhat” method="post" enctype="multipart/form-data"/> </nomatch>
<nomatch> <prompt>Please enter your PIN number again. </prompt> <reprompt/> </nomatch>
<prompt>Please enter your 4 digit PIN using your touch tone key pad followed by the pound sign, or say a name.</prompt>
<filled> <submit next=”login.php” namelist=”main”/> </filled>
</field>
Again, I haven’t had a chance to test this, and your selection of a VoiceXML platform may determine whether this approach will work. Hope this helps.
Good luck. [ August 12, 2005, 01:08 PM: Message edited by: mheadd ]
-------------------- Mark VoiceinGov.org http://www.voiceingov.org
Posts: 55 | Registered: Jun 2005
| IP: Logged
|
|
tfpet
Junior Member
Member # 3213
|
posted August 12, 2005 03:10 PM
mark,
thank you very much for your reply! it didn't seem to work on our platform. we have vxml 2.0, and property recordutterance and .lastaudio are not supported. basically, when the field is associated with digits type grammar, it does not recognize the voice uttered, and did not fall into the nomatch case. it simply went back to the prompt...
assuming i have to go with 2.0, do you see any workaround to get this working?
thanks again!! -tf
Posts: 3 | Registered: Aug 2005
| IP: Logged
|
|
mheadd
Member
Member # 3181
Member Rated:
|
posted August 12, 2005 04:28 PM
Here are your options.
1). If you decide to go with a platform that supports the relevent parts of the 2.1 spec, the following code should work (I tested it successfully on the BeVocal platform). Note in copying this code: all form tags need to be prepended by < in order to work, as this tag is not allowed by the bulletin board application.
<?xml version="1.0"?> <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<property name="recordutterance" value="true"/>
form id="login">
<field name="main" type="digits?length=4">
<!-- ***** This nomatch handler will take care of utterances that are not recognized by the ASR engine. ***** --> <nomatch> <if cond="application.lastresult$.inputmode=='voice'"> <var name="sayWhat" expr="application.lastaudio$"/> <prompt>I heard you say <audio expr="sayWhat"/></prompt> <else/> <prompt>Please enter your PIN number again. </prompt> <reprompt/> </if> </nomatch>
<prompt>Please enter your 4 digit PIN using your touch tone key pad, or say a name.</prompt>
<filled>
<!-- ***** This if statement will take care of utterances that the ASR engine interprets as digits, but are received a spoken input. ***** -->
<if cond="main$.inputmode=='voice'"> <var name="sayWhat" expr="application.lastaudio$"/> <prompt>You said <audio expr="sayWhat"/></prompt> <!-- ***** This else statement will take care of utterances that the ASR engine interprets as digits, and are input using DTMF. ***** --> <else/> <prompt>You entered a PIN of <say-as type="number:digits"><value expr="main"/></say-as></prompt> </if> </filled>
</field>
/form> </vxml>
2). If using a different platform is not an option, you could use the same approach as above to test for the type of input provided by the caller. If the type of input is voice, you could then redirect the caller to another form or dialog and then record the audio input. Something like the following (note - untested):
<nomatch> <if cond="application.lastresult$.inputmode=='voice'"> <goto next="#audioCapture"/> <else/> <prompt>Please enter your PIN number again. </prompt> <reprompt/> </if> </nomatch>
...
form id="audioCapture"> <record name="greeting" beep="true" maxtime="10s" finalsilence="2000ms"> <prompt>Please say a name.</prompt> </record> /form>
The drawback here is that the caller will have to say the name twice, once for the application to detect the input type, and again to record it. I don't know of any way in 2.0 to store the audio of the caller's utterance while it is examned to see if it is voice or dtmf input.
Hope this helps.
-------------------- Mark VoiceinGov.org http://www.voiceingov.org
Posts: 55 | Registered: Jun 2005
| IP: Logged
|
|
|