Tropo is part of CiscoLearn More

Multilingual Speech Recognition

On the other side of the multinational coin is recognizing input from a different language. This is controlled by the recognizer parameter. Most of the languages supported by voice are supported by recognizer. A complete list appears below.

Language Recognizer
Afrikaans af-za
Arabic ar-ww
Arabic (Jordanian) ar-jo
Assamese as-in
Basque eu-es
Bengali bn-bd
Bengali (Indian) bn-in
Bhojpuri bh-in
Bulgarian bg-bg
Cantonese cn-hk
Catalan ca-es
Czech cs-cz
Danish da-dk
Dutch nl-nl
Dutch (Belgian) nl-be
English (Australian) en-au
English (Indian) en-in
English (Singaporean) en-sg
English (South African) en-za
English (UK) en-gb
English (US) en-us (Default)
Finnish fi-fi
French fr-fr
French (Belgian) fr-be
French (Canadian) fr-ca
Galician gl-es
German de-de
German (Austrian) de-at
German (Swiss) de-ch
Greek el-gr
Gujarati gu-in
Hebrew he-il
Hindi hi-in
Hungarian hu-hu
Icelandic is-is
Indonesian id-id
Italian it-it
Japanese ja-jp
Kannada kn-in
Korean ko-kr
Malay ms-my
Malayalam ml-in
Mandarin zh-cn
Mandarin (Taiwanese) zh-tw
Marathi mr-in
Nepali ne-np
Norwegian no-no
Oriya or-in
Polish pl-pl
Portuguese pt-pt
Portuguese (Brazilian) pt-br
Punjabi pa-in
Romanian ro-ro
Russian ru-ru
Serbian sr-rs
Slovak sk-sk
Slovenian sl-si
Spanish es-es
Spanish (Argentinian) es-ar
Spanish (Colombian) es-co
Spanish (US & Mexican) es-us
Swedish sv-se
Tamil ta-in
Telugu te-in
Thai th-th
Turkish tr-tr
Ukrainian uk-ua
Urdu (Indian) ur-in
Urdu (Pakistani) ur-pk
Valencian va-es
Vietnamese vi-vn
Welsh cy-gb

While we have several options, Tropo can only listen for one language at a time, so it’s important to tell it which language to expect. Here's an example using both voice and recognizer with Argentinian Spanish; we included the same example in US English for comparison:

ask("What's your four digit pin?", {
    choices:"[4 DIGITS]",
    mode:"speech",
    recognizer:"en-us",
    onChoice: function(event) {
        say("Thank you");
    }
});
	
ask("¿Cuál es su número de identificación?", {
    voice:"Angelica",
    choices:"[4 DIGITS]",
    mode:"speech",
    recognizer:"es-ar",
    onChoice: function(event) {
        say("Gracias.", {voice:"Angelica"});
    }
});
ask "What's your four digit pin?", {
    :choices => "[4 DIGITS]",
    :mode => "speech",
    :recognizer => "en-us", #will recognize 'one two three four'
    :onChoice => lambda { |event| 
         say "Thank you."}
}

ask "¿Cuál es su número de identificación?", {
    :voice => "Angelica",
    :choices => "[4 DIGITS]",
    :mode => "speech",
    :recognizer => "es-ar", #will recognize 'uno dos tres quatro'
    :onChoice => lambda { |event|
        say "Gracias.", {:voice => "Angelica"}
    }}
<?php
    ask("What's your four digit pin?", array(
        "choices" => "[4 DIGITS]",
        "mode" => "speech",
        "recognizer"=>"en-us", // will recognize 'one two three four'
        "onChoice"=>"choiceFCN")
    );
    function choiceFCN($event) { 
    say("Thank you.");
    }
?>
	
<?php
    ask("¿Cuál es su número de identificación?", array(
        "voice"=>"Angelica", 
        "choices"=>"[4 DIGITS]",
        "mode"=>"speech",
        "recognizer"=>"es-ar", // will recognize 'uno dos tres quatro'
        "onChoice"=>"choiceFCN"
        )
    );
    function choiceFCN($event) {
    say("Gracias.", array("voice"=>"Angelica"));
    }
?>
ask("What's your four digit pin?", {
    "choices":"[4 DIGITS]",
    "mode":"speech",
    "recognizer":"en-us",   # will recognize 'one two three four'
    "onChoice" : lambda event : say("Thank you")
})
	
ask("¿Cuál es su número de identificación?", {
    "voice":"Angelica",
    "choices":"[4 DIGITS]",
    "mode":"speech",
    "recognizer":"es-ar", # will recognize 'uno dos tres quatro'
    "onChoice" : lambda event : say("Gracias", {"voice":"Angelica"})
})
ask("What's your four digit pin?", [
    choices: "[4 DIGITS]",
    mode: "speech",
    recognizer: "en-us",  // will recognize 'one two three four'
    onChoice: {event -> say("Thank you")}
])
	
ask("¿Cuál es su número de identificación?", [
    voice: "Angelica",
    choices: "[4 DIGITS]",
    mode: "speech",
    recognizer: "es-ar",  //will recognize 'uno dos tres quatro'
    onChoice: {event -> say("Gracias", [voice: "Angelica"])}
])

Note

With Python, if the recognition string you're using has non-Latin characters included, you will need to include the letter "u" before the quotation to tell Python it's Unicode. It would look something like:

say(u"Welche Straße kann ich nehmen?")