Skip to content
GaudiGaudi Design System home

Search documentation

Search every page, heading and paragraph.

ChatVoice

Voice building blocks: ChatSpeechInput dictates into the composer, ChatMicSelector picks the input device, ChatVoiceSelector picks the voice that answers and ChatAudioPlayer plays voice messages and spoken replies.

Chat@gaudi/design-system/chat/ChatVoiceView in StorybookSource

Installation

pnpm add github:ahmadassaf/design-system

Import from @gaudi/design-system. Load @gaudi/design-system/global.css once and add transpilePackages: ['@gaudi/design-system'] in Next.js.

import { ChatAudioPlayer } from '@gaudi/design-system/chat/ChatVoice';

Usage

import { ChatAudioPlayer, ChatMicSelector, ChatSpeechInput, ChatVoiceSelector } from '@gaudi/design-system/chat';
<><ChatMicSelector value={deviceId} onValueChange={setDeviceId} /><ChatSpeechInput deviceId={deviceId} onInterim={setPreview} onTranscript={append} onAudio={transcribe} /><ChatVoiceSelector voices={voices} groupBy='provider' value={voice} onValueChange={setVoice} onPreview={speakSample} /><ChatAudioPlayer src={reply.audioUrl} title='Reply' peaks={reply.peaks} download='reply.mp3' /></>

Examples

Voice mode

Storybook

Cancel capture and pending transcription

Storybook

API

26 props

Accessibility

ChatSpeechInput is a pressed-state button stopped by Escape that announces listening and transcribing politely and explains when it is disabled; ChatMicSelector names its select and explains a blocked permission; ChatVoiceSelector is a fieldset of native radios with named sample buttons; the ChatAudioPlayer scrubber is a slider that reads time.