Search code examples
speech-recognitionspeech-to-textapi-ai

Why voximal doesn't record my speech?


I'm trying to integrate a bot that we are creating with api.ai. I've managed to configure almost everything. I can make a call, and hear the text that I've entered in the XML file. However, when I'm answering there is no input recorded.

I've created a google speech API key and added it in the "recognition" but no success, it doesn't take my speech input.

Here is my recognition tab: enter image description here

and here is my XML CODE example:

<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" xml:lang="en-GB">
<property name="confidencelevel" value="0.3"/>
<property name="inputmodes" value="voice dtmf"/>
<form id="menu">
    <field name="food">
    <grammar xml:lang="en-US" root="food">
        <rule id="food">
        <one-of>
            <item>!pizza
            <tag>pizza</tag>
            </item>
            <item>!cupcake
            <tag>cupcake</tag>
            </item>
            <item>!hamburger
            <tag>hamburger</tag>
            </item>
        </one-of>
        </rule>
    </grammar>
    <grammar mode="dtmf" root="food">
        <rule id="food2">
        <one-of>
            <item>1</item>
            <item>2</item>
            <item>3</item>
        </one-of>
        </rule>
    </grammar>
    <prompt bargein="false">
        What do you want?
        Say pizza or press 1,
        Say cupcake or press 2,
        Say hamburger or press 3.
    </prompt>
    </field>
    <filled>
    <log label="Section: " expr="food" />
    <script>
        <![CDATA[ var ordered = "";
        switch (food){
        case "pizza" : ordered = "#pizza"; break;
        case "1" : ordered = "#pizza"; break;
        case "cupcake" : ordered = "#cupcake"; break;
        case "2" : ordered = "#cupcake"; break;
        case "hamburger" : ordered = "#hamburger"; break;
        case "3" : ordered = "#hamburger"; break;
        default: ordered = "#outOfStock"; break; } ]]>
    </script>
    <goto expr="ordered"/>
    </filled>
</form>
<form id="pizza">
    <block>
    <!-- Selected pizza -->
    <log label="Selection: PIZZA" />
    <prompt>You selected: PIZZA</prompt>
    <goto next="#menu" />
    </block>
</form>
<form id="cupcake">
    <block>
    <!-- Selected cupcake -->
    <log label="Selection: CUPCAKE" />
    <prompt>You selected: CUPCAKE</prompt>
    <goto next="#menu" />
    </block>
</form>
<form id="hamburger">
    <block>
    <!-- Selected hamburger -->
    <log label="Selection: HAMBURGER" />
    <prompt>You selected: HAMBURGER</prompt>
    <goto next="#menu" />
    </block>
</form>
<form id="outOfStock">
    <block>
    <prompt>This is not a option.</prompt>
    <goto next="#menu" />
    </block>
</form>
<form id="goodbye">
    <block>
    <prompt>Goodbye</prompt>
    </block>
</form>
</vxml>

and here is my LOG file: enter image description here


Solution

  • After checking with Eli, the issue was an invalid Google key. You need to enable the Google Speech API from your Cloud Console. This error is not very easy to detect. We are working to improve this part in the next Voximal release.