Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

AssemblyAI/assemblyai-algolia-voice-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AssemblyAI Voice Search Widget

Using this widget, you can effortlessly add voice search to your website and/or app.

Getting Started

1: Include AssemblyAI

<script src="https://cdn.jsdelivr.net/gh/assemblyai/assemblyai-algolia-voice-widget/public/assemblyai-voice-helper.js"></script>

2. Configure Algolia InstantSearch

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();

Supported Platforms Browsers

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

Supported Languages

At this time, only English (all accents) is supported.

Getting an AssemblyAI API Token

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.

  1. Register for an AssemblyAI API token here
  2. Add a credit card to your AssemblyAI account here
  3. Pricing is billed at $0.008 per request to AssemblyAI.

Feedback and Support

For questions about AssemblyAI, please email [email protected]. For questions about Algolia, please visit Algolia's support center here.

Dev

Build

https://github.com/AssemblyAI/assemblyai-algolia-voice-widget
cd assemblyai-voice-widget
npm install
npm run build

Development

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)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published