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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@veeramani1234/voice-to-text

v1.0.42

Published

Multi-framework real-time Voice-to-Text WebSocket streaming client

Readme

@veeramani1234/voice-to-text

A premium, production-ready, highly customizable React voice-to-text floating microphone package. It connects to the fyral.ai WebSocket streaming endpoint, captures microphone input, and automatically inserts live transcripts into focused inputs, textareas, and contenteditable elements.

This package works seamlessly across all major React build setups (Vite, Next.js, Create React App) and is fully compatible with third-party UI component libraries (HeroUI, MUI, Ant Design, Chakra UI, Mantine).


Features

  • 🎙️ Vanilla JS Core: Lightweight, zero-dependency engine written in TypeScript.
  • ⚛️ First-Class React / Next.js Support: Includes custom hooks and a pre-styled premium microphone button.
  • 🎛️ Floating & Draggable Component: React button component features optional smooth fixed-positioning and drag-to-reposition capabilities.
  • SSR Safe: Fully optimized for Server-Side Rendering (Next.js App & Pages Routers).
  • 🧩 Angular & Vue Compatible: Decoupled entry points prevent React bundle pollution in non-React applications.

Installation

npm install react-voice-floating-mic

Usage

1. Using the Button Component (VoiceToTextButton)

Place the floating microphone button at the root of your application (or within a portal).

import React from 'react';
import { VoiceToTextButton } from 'react-voice-floating-mic';

export default function App() {
  return (
    <div className="app-container">
      <h2>Voice Enabled Form</h2>
      <input type="text" placeholder="Click to focus input and start speaking..." />
      <div contenteditable="true" style={{ border: '1px solid #ccc', minHeight: '100px', padding: '8px' }}>
        Click to focus contenteditable and dictate...
      </div>

      {/* Floating draggable microphone widget */}
      <VoiceToTextButton
        projectId="YOUR_FYRAL_PROJECT_ID"
        floating={true}
        insertIntoFocusedInput={true}
        size="md"
        accentColor="#4f46e5"
        recordingColor="#ef4444"
      />
    </div>
  );
}

2. Using the Custom Hook (useVoiceToText)

Provides hooks and actions to build your own custom voice-to-text elements.

import React from 'react';
import { useVoiceToText } from 'react-voice-floating-mic';

export default function CustomTranscriber() {
  const {
    isRecording,
    isConnected,
    transcript,
    error,
    startRecording,
    stopRecording,
    resetTranscript,
  } = useVoiceToText({
    projectId: 'YOUR_PROJECT_ID',
    autoStopTimeout: 60000,
    onTranscript: (text, isFinal) => {
      console.log(`Transcribed: ${text} (Final: ${isFinal})`);
    },
  });

  return (
    <div>
      <p>Status: {isRecording ? (isConnected ? 'Recording...' : 'Connecting...') : 'Idle'}</p>
      <button onClick={isRecording ? stopRecording : startRecording}>
        {isRecording ? 'Stop' : 'Start'}
      </button>
      <button onClick={resetTranscript}>Reset</button>
      {error && <p style={{ color: 'red' }}>{error}</p>}
      <div>{transcript}</div>
    </div>
  );
}

API & Props Reference (VoiceToTextButton)

| Prop | Type | Default | Description | |---|---|---|---| | projectId | string | Required | Your project ID for authorization. | | apiWssUrl | string | wss://fyral.ai/api/ws/transcribe?project_id= | Overrides the WebSocket endpoint URL. | | className | string | "" | Additional CSS class for the button container. | | style | React.CSSProperties | undefined | Inline styles for the button container. | | buttonLabel | string | undefined | Visual text label rendered inside the button (changes it from circular to pill-shaped). | | accentColor | string | "#4f46e5" | Idle ripple animations and custom outline/focus border colors. | | recordingColor | string | "#ef4444" | Recording ripples and indicator animations color. | | micColor | string | "#ffffff" | Icon stroke and fill color. | | backgroundColor | string | undefined | Custom gradient/color overrides for the idle button state. | | recordingBackgroundColor | string | undefined | Custom gradient/color overrides for the recording button state. | | removeBg | boolean | false | If true, removes background gradients and shadows (transparent mode). | | insertIntoFocusedInput | boolean | true | Inserts transcription directly into the currently focused editable element. | | micIcon | React.ReactNode | undefined | Custom icon to render during idle state. | | stopIcon | React.ReactNode | undefined | Custom icon to render during recording state. | | autoStopTimeout | number | 120000 (120s) | Timeout duration in milliseconds to automatically stop recording. | | floating | boolean | false | Enables floating widget layout and Pointer Events dragging. | | defaultVisible | boolean | true | Initial visibility state of the button widget. Toggle with Ctrl+M. | | size | 'sm' \| 'md' \| 'lg' \| number | 'md' | Adjusts button diameter (sm: 48px, md: 64px, lg: 80px, or custom pixel numbers). | | onTranscriptChange | (transcript: string) => void | undefined | Callback fired when the transcript updates. | | onRecordingChange | (isRecording: boolean) => void | undefined | Callback fired when recording state changes. | | onConnectedChange | (isConnected: boolean) => void | undefined | Callback fired when connection state changes. | | onErrorChange | (error: string \| null) => void | undefined | Callback fired when errors are received. | | isDrawerOpen | boolean | undefined | Prop to notify the button when a drawer or modal overlay opens. | | portalContainer | HTMLElement \| null \| string | document.body | Custom selector or element to portal the button into. |