npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@aivue/voice-actions

v1.0.2

Published

AI-powered voice command controller with speech recognition, natural language processing, and custom actions for Vue.js

Downloads

278

Readme

@aivue/voice-actions

npm version License: MIT Netlify Status npm downloads

🎤 AI-powered voice command controller with speech recognition, natural language processing, and custom actions for Vue.js

Transform your Vue applications with powerful voice control capabilities. @aivue/voice-actions provides an intuitive interface for voice commands, speech recognition, and AI-powered natural language processing.

✨ Features

🎯 Core Features

  • 🎤 Speech Recognition - Real-time voice-to-text conversion
  • 🗣️ Text-to-Speech - Voice feedback for commands
  • 🤖 AI Processing - Natural language understanding with AI
  • ⚡ Custom Commands - Register and execute custom voice commands
  • 🔄 Continuous Mode - Keep listening for commands
  • 👂 Wake Word Detection - Activate with custom wake words
  • 🌍 Multi-language - Support for 12+ languages
  • 📊 Command History - Track and review executed commands

🎨 UI Features

  • 🎨 Customizable Themes - Light and dark mode support
  • 📱 Responsive Design - Works on all devices
  • 🔊 Volume Indicator - Visual feedback for audio levels
  • 💬 Live Transcript - See what you're saying in real-time
  • ✅ Confidence Score - Visual confidence indicator
  • 💡 Smart Suggestions - Contextual command suggestions

🚀 Advanced Features

  • 🔌 Composable API - Use programmatically with useVoiceActions
  • 🎯 Pattern Matching - Regex and string pattern support
  • 📈 Analytics - Track command usage and success rates
  • ⌨️ Keyboard Shortcuts - Alternative input methods
  • ♿ Accessibility - ARIA labels and keyboard navigation
  • 🔒 Privacy-focused - All processing happens locally

📦 Installation

npm install @aivue/voice-actions @aivue/core

🚀 Quick Start

<template>
  <div>
    <VoiceActions
      :ai-client="aiClient"
      :commands="commands"
      :suggestions="suggestions"
      show-transcript
      show-suggestions
      show-history
      voice-feedback
      @command="handleCommand"
    />
  </div>
</template>

<script setup>
import { VoiceActions } from '@aivue/voice-actions';
import { AIClient } from '@aivue/core';

const aiClient = new AIClient({
  provider: 'openai',
  apiKey: 'your-api-key'
});

const commands = [
  {
    pattern: /open (.*)/i,
    action: (matches) => {
      console.log('Opening:', matches[1]);
      window.location.href = `/${matches[1]}`;
    },
    description: 'Open a page',
    icon: '🔗'
  },
  {
    pattern: /search for (.*)/i,
    action: (matches) => {
      console.log('Searching for:', matches[1]);
      // Perform search
    },
    description: 'Search for something',
    icon: '🔍'
  }
];

const suggestions = [
  { text: 'Open dashboard', icon: '📊' },
  { text: 'Search for products', icon: '🔍' },
  { text: 'Show help', icon: '❓' }
];

function handleCommand(command, result) {
  console.log('Command executed:', command, result);
}
</script>

📖 Usage Examples

Basic Voice Commands

<template>
  <VoiceActions
    :commands="commands"
    show-transcript
    @command="onCommand"
  />
</template>

<script setup>
import { VoiceActions } from '@aivue/voice-actions';

const commands = [
  {
    pattern: 'hello',
    action: () => alert('Hello!'),
    description: 'Say hello'
  },
  {
    pattern: /go to (home|about|contact)/i,
    action: (matches) => {
      router.push(`/${matches[1]}`);
    },
    description: 'Navigate to pages'
  }
];

function onCommand(command, result) {
  console.log('Command:', command);
}
</script>

AI-Powered Processing

<template>
  <VoiceActions
    :ai-client="aiClient"
    use-ai-processing
    voice-feedback
    show-transcript
  />
</template>

<script setup>
import { VoiceActions } from '@aivue/voice-actions';
import { AIClient } from '@aivue/core';

const aiClient = new AIClient({
  provider: 'openai',
  apiKey: import.meta.env.VITE_OPENAI_API_KEY
});
</script>

Continuous Listening Mode

<template>
  <VoiceActions
    :commands="commands"
    continuous-mode
    show-continuous-toggle
    wake-word="hey assistant"
    wake-word-enabled
  />
</template>

Multi-language Support

<template>
  <VoiceActions
    :commands="commands"
    language="es-ES"
    show-language-selector
    show-transcript
  />
</template>

Custom Styling

<template>
  <VoiceActions
    :commands="commands"
    theme="dark"
    show-volume-indicator
    show-transcript
  />
</template>

<style>
.voice-actions {
  max-width: 600px;
  margin: 0 auto;
}
</style>

🎯 API Reference

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | aiClient | AIClient | undefined | AI client for natural language processing | | commands | VoiceCommand[] | [] | Array of voice commands to register | | suggestions | VoiceActionsSuggestion[] | [] | Command suggestions to display | | theme | 'light' \| 'dark' | 'light' | UI theme | | language | string | 'en-US' | Speech recognition language | | showTranscript | boolean | true | Show live transcript | | showSuggestions | boolean | true | Show command suggestions | | showHistory | boolean | true | Show command history | | showLanguageSelector | boolean | false | Show language selector | | showContinuousToggle | boolean | false | Show continuous mode toggle | | showVolumeIndicator | boolean | false | Show volume level indicator | | continuousMode | boolean | false | Enable continuous listening | | wakeWord | string | undefined | Wake word to activate commands | | wakeWordEnabled | boolean | false | Enable wake word detection | | voiceFeedback | boolean | false | Enable voice feedback | | maxHistoryDisplay | number | 10 | Maximum history items to display | | transcriptLabel | string | 'You said' | Label for transcript section | | useAiProcessing | boolean | false | Use AI for unmatched commands |

Events

| Event | Payload | Description | |-------|---------|-------------| | command | (command: string, result?: any) | Emitted when a command is executed | | transcript | (transcript: string) | Emitted when transcript updates | | error | (error: Error) | Emitted on errors | | listening-start | () | Emitted when listening starts | | listening-stop | () | Emitted when listening stops | | wake-word-detected | () | Emitted when wake word is detected |

Types

VoiceCommand

interface VoiceCommand {
  pattern: string | RegExp;
  action: (matches?: string[]) => void | Promise<void>;
  description?: string;
  icon?: string;
}

VoiceActionsSuggestion

interface VoiceActionsSuggestion {
  text: string;
  command?: string;
  icon?: string;
}

CommandHistoryItem

interface CommandHistoryItem {
  command: string;
  timestamp: Date;
  status: 'success' | 'error' | 'pending';
  result?: any;
}

🔧 Composable API

Use the useVoiceActions composable for programmatic control:

import { useVoiceActions } from '@aivue/voice-actions';

const {
  state,
  isListening,
  isProcessing,
  transcript,
  confidence,
  error,
  isSupported,
  initialize,
  start,
  stop,
  speak,
  cleanup
} = useVoiceActions({
  aiClient,
  commands,
  language: 'en-US',
  continuousMode: false,
  voiceFeedback: true
});

// Initialize
initialize();

// Start listening
start();

// Stop listening
stop();

// Speak text
speak('Hello, world!');

// Cleanup
cleanup();

🛠️ Utilities

Command Parser

import { parseCommand, matchCommand, findBestMatch } from '@aivue/voice-actions';

// Parse command
const parsed = parseCommand('search for laptops');
// { command: 'search for laptops', intent: 'search', entities: {...}, confidence: 1.0 }

// Match command
const matches = matchCommand('open dashboard', /open (.*)/i);
// ['open dashboard', 'dashboard']

// Find best match
const best = findBestMatch('search products', commands);
// { index: 2, confidence: 0.85 }

Speech Synthesis

import { speak, getVoices, SpeechQueue } from '@aivue/voice-actions';

// Speak text
await speak('Hello, world!', {
  lang: 'en-US',
  rate: 1.0,
  pitch: 1.0,
  volume: 1.0
});

// Get available voices
const voices = await getVoices();

// Use speech queue
const queue = new SpeechQueue();
queue.add('First message');
queue.add('Second message');
queue.add('Third message');

🌍 Supported Languages

  • 🇺🇸 English (US) - en-US
  • 🇬🇧 English (UK) - en-GB
  • 🇪🇸 Spanish - es-ES
  • 🇫🇷 French - fr-FR
  • 🇩🇪 German - de-DE
  • 🇮🇹 Italian - it-IT
  • 🇧🇷 Portuguese - pt-BR
  • 🇯🇵 Japanese - ja-JP
  • 🇨🇳 Chinese - zh-CN
  • 🇰🇷 Korean - ko-KR
  • 🇮🇳 Hindi - hi-IN
  • 🇸🇦 Arabic - ar-SA

🎨 Styling

The component uses scoped styles and CSS variables for easy customization:

.voice-actions {
  --voice-primary: #667eea;
  --voice-secondary: #764ba2;
  --voice-success: #10b981;
  --voice-error: #ef4444;
  --voice-text: #1f2937;
  --voice-bg: #ffffff;
}

📝 Examples

Smart Home Control

<template>
  <VoiceActions
    :commands="smartHomeCommands"
    continuous-mode
    wake-word="hey home"
    wake-word-enabled
    voice-feedback
  />
</template>

<script setup>
const smartHomeCommands = [
  {
    pattern: /turn (on|off) the (.*)/i,
    action: (matches) => {
      const [, state, device] = matches;
      controlDevice(device, state === 'on');
    },
    description: 'Control devices'
  },
  {
    pattern: /set (.*) to (\d+) percent/i,
    action: (matches) => {
      const [, device, level] = matches;
      setDeviceLevel(device, parseInt(level));
    },
    description: 'Set device level'
  }
];
</script>

Navigation Assistant

<template>
  <VoiceActions
    :commands="navCommands"
    :suggestions="navSuggestions"
    show-suggestions
    voice-feedback
  />
</template>

<script setup>
const navCommands = [
  {
    pattern: /go to (.*)/i,
    action: (matches) => router.push(`/${matches[1]}`),
    icon: '🔗'
  },
  {
    pattern: /go back/i,
    action: () => router.back(),
    icon: '⬅️'
  }
];

const navSuggestions = [
  { text: 'Go to dashboard', icon: '📊' },
  { text: 'Go to settings', icon: '⚙️' },
  { text: 'Go back', icon: '⬅️' }
];
</script>

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📦 Related Packages

Explore the complete @aivue ecosystem:

🧠 @aivue/core

Core AI functionality for Vue.js components

💬 @aivue/chatbot

AI-powered chat components for Vue.js

@aivue/autosuggest

AI-powered suggestion components for Vue.js

📝 @aivue/smartform

AI-powered form validation for Vue.js

🎭 @aivue/emotion-ui

Emotion-aware UI components with sentiment analysis

📄 @aivue/doc-intelligence

Document processing and OCR with AI

🧠 @aivue/predictive-input

AI-powered predictive text input

🔔 @aivue/smart-notify

Intelligent notification system

📋 @aivue/smart-datatable

Advanced data table components

🖼️ @aivue/image-caption

AI-powered image captioning with OpenAI Vision models

📊 @aivue/analytics

AI-powered analytics and insights

📄 License

MIT © reachbrt

🔗 Links

🌟 Star History

Star History Chart