Skip to content
Sign in
AudioVoice libraryMenu

Voice libraryPro

A voice grid with search and filters by accent, use case and register, each card with its sample and waveform in place. The library scale variant of the free voice-picker.

ProTwelve voices with search and filters by accent, use case and register. Play any sample in place.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/voice-library

Usage

tsx
import { VoiceLibrary } from "@/components/ui/chatcn/pro/voice-library"

<VoiceLibrary voices={voices} value={voiceId} onValueChange={setVoiceId} onLockedSelect={openUpgrade} />

Filters come from the voices themselves, so a library with no accents shows no accent filter. A card plays previewUrl, or getSample(voice) when you pass it. Voices with a plan wear a lock and call onLockedSelect instead of being picked. Use the free voice-picker for short lists in a toolbar.

The examples play a demo synthesizer built on the Web Audio API (renderBabble and renderSfx in @/lib/chatcn-pro-speech): it sounds like a voice behind a wall, so nothing pretends to be a real model. Pass your API's audio as URLs or buffers instead.

Examples

States

ProLoading, filtered, no matches, failed and an empty library.

Props

PropTypeNotes
voicesSpeechVoice[]Required. Name, description, accent, use case, register, tags
value, defaultValue, onValueChangestring
filters, defaultFilters, onFiltersChangeVoiceLibraryFiltersQuery, accents, use cases, registers
getSample(voice) => SpeechSourceDefault previewUrl
onLockedSelect(voice) => void
loading, error, onRetry
hideToolbar, disabledboolean
labelsPartial<VoiceLibraryLabels>Every string the library shows or announces, for translation

Keyboard

KeyAction
Arrow keysMove between cards, by row and column
Home, EndFirst and last card
EnterPick the voice
SpacePlay or stop the sample

Accessibility

  • The grid is a listbox with one tab stop; each card is an option named with the voice, its description and facts.
  • The result count is a polite live region. Playback errors are announced.

Motion

  • Filter menus grow from their trigger in 180 ms. Results swap at once. A playing card fills its waveform and rings its play button. Cards press at 0.97; nothing lifts on hover.