Using this widget, you can effortlessly add voice search to your website and/or app.
- Getting Started
- Supported Platforms/Browsers
- Supported Languages
- Getting an AssemblyAI API Token
- Feedback/Support
<script src="https://cdn.jsdelivr.net/gh/assemblyai/assemblyai-algolia-voice-widget/public/assemblyai-voice-helper.js"></script>
The below Voice Search Widget requires you have an AssemblyAI Token, which you can get here
const search = instantsearch({
indexName: '...',
searchClient: algoliasearch('...', '...'),
});
search.addWidgets([
instantsearch.widgets.hits({
container: '#hits',
}),
instantsearch.widgets.searchBox({
container: '#searchbox'
}),
instantsearch.widgets.voiceSearch({
container: '#voicesearch',
createVoiceSearchHelper: window.assemblyAIHelper(
'xxxxxxxxxxxxxxx', // Your AssemblyAI API Token
{
word_boost: ['AssemblyAI', 'Google', 'Facebook'], // AssemblyAI word_boost parameter. See: https://docs.assemblyai.com/all-guides/synchronous-transcription-for-short-audio-files#boost
format_text: true // AssemblyAI format_text parameter. See: https://docs.assemblyai.com/all-guides/synchronous-transcription-for-short-audio-files#format
}
),
cssClasses: {
root: ['AssemblyAIHelper'] // Add AssemblyAI stylings or use your own
},
templates: {
status: ({errorCode}) => Boolean(errorCode) ? `<div>${errorCode}</div>` : '' // AssemblyAI error handling
}
}),
// ... other configurations
]);
search.start();
Browser | Supported |
---|---|
Dekstop Safari | Yes |
Desktop Chrome | Yes |
Desktop Firefox | Yes |
iOS Safari | Yes |
iOS Chrome | No |
iOS Firefox | No |
Android Chrome | Yes |
Android Firefox | Yes |
At this time, only English (all accents) is supported.
AssemblyAI is a Speech-to-Text API that can convert voice into text. You must have an AssemblyAI API Token to use this voice search widget.
- Register for an AssemblyAI API token here
- Add a credit card to your AssemblyAI account here
- Pricing is billed at $0.008 per request to AssemblyAI.
For questions about AssemblyAI, please email [email protected]. For questions about Algolia, please visit Algolia's support center here.
https://github.com/AssemblyAI/assemblyai-algolia-voice-widget
cd assemblyai-voice-widget
npm install
npm run build
https://github.com/AssemblyAI/assemblyai-algolia-voice-widget
cd assemblyai-voice-widget
npm install
npm run dev // Server is running with webpack-dev-server (http://localhost:3000)