Overview
This guide will walk you through creating a fully functional audio recorder with real-time visualization. You’ll learn how to use theuseVoiceVisualizer hook and VoiceVisualizer component to build a complete audio recording experience.
Installation
First, install the package if you haven’t already:Basic Implementation
Initialize the recorder controls
Use the
useVoiceVisualizer hook to initialize the recorder controls. This hook returns all the state and functions needed to manage audio recording:Access the recorded audio
Use React’s
useEffect hook to access the recorded audio blob when recording completes:The
recordedBlob is a Blob object containing the recorded audio in WebM format. You can upload it to a server, convert it to other formats using libraries like FFmpeg, or play it back directly.Complete Example
Here’s the complete code for a basic audio recorder with visualization:App.tsx
What You Get Out of the Box
With this minimal setup, you automatically get:- Microphone Access: Automatic browser permission handling
- Real-Time Visualization: Animated audio waveforms during recording
- Recording Controls: Start, pause, resume, and stop recording
- Playback Controls: Play, pause, and seek through recorded audio
- Time Tracking: Display of recording time and audio duration
- Audio Export: Access to the recorded audio as a Blob for upload or processing
- Error Handling: Automatic error management for recording and playback
Using Recorder Controls
TheuseVoiceVisualizer hook returns an object with many useful properties and functions:
API Reference
See the complete API documentation for all available controls and states
Next Steps
Customization
Learn how to customize colors, dimensions, and appearance
Advanced Usage
Build custom UI controls and handle advanced use cases
API Reference
Explore all available props, methods, and callbacks
Basic Usage Guide
Browse code examples and common patterns

