How to implement Voice Search

Voice Search allows your visitors to enter a search term by voice.

To enable the Voice Search feature, add the following value to the cludoSettings object of your search script:

enableVoiceSearch: true

For context, here’s an example of what the full code snippet could look like:

<script type="text/javascript" src="//customer.cludo.com/scripts/bundles/search-script.min.js"></script>
    <script>
        var CludoSearch;
        (function () {
            var cludoSettings = {
                customerId: XXXX,
                engineId: XXXX,
                searchUrl: "/search/",
                searchInputs: ["cludo-search-form"],
                loading: "<img src='//customer.cludo.com/img/loading.gif' class='loading' />",
                enableVoiceSearch: true
            };
            CludoSearch = new Cludo(cludoSettings);
            CludoSearch.init();
        })();
</script>

Note: The Voice Search feature is based on WebSpeech API, which is not supported by all browsers. Please note that as of now, the feature is not available on Firefox. Go here for an up-to-date view of which browsers support voice search.

Tags: