1.0.4 • Published 7 months ago

@hoosei/voxweave-avatars v1.0.4

Weekly downloads
-
License
SEE LICENSE IN ./...
Repository
github
Last release
7 months ago

Voxweave Avatars

Voxweave Avatars is a collection of customizable and interactive voice UI animations for the Voxweave's React Component. It provides visually stunning three.js and webgl visualizations for voice interactions, perfect for your AI Agent user interface.

Features

  • 🎨 Multiple animation styles for different visual experiences
  • 🌓 Light and dark mode compatible
  • 📊 Real-time audio responsive animations
  • ⚡️ Optimized performance with Three.js
  • 🚀 WebGL-powered rendering
  • 🔒 Type-safe implementation
  • ✅ Seamless integration with Voxweave React

Installation

You can install Voxweave Avatars using npm, pnpm, or bun:

# Using npm
npm install @hoosei/voxweave-avatars

# Using pnpm
pnpm add @hoosei/voxweave-avatars   

# Using bun
bun add @hoosei/voxweave-avatars

Quick Start

Import and use the animations directly with Voxweave React:

import { Voxweave } from '@hoosei/voxweave-react'
import { BlobAnimation } from '@hoosei/voxweave-avatars'

function YourComponent() {
  return (
    <Voxweave
      animation={BlobAnimation}
      isListening={true}
      size={180}
      // other props...
      onStartCall={() => {
        // Handle call start
      }}
      onClose={() => {
        // Handle close
      }}
    />
  )
}

Usage

To use Voxweave Avatars in your React application, follow these steps:

  1. Import the components you need:
import { AvatarWaveAnimation, BlobAnimation, AuroraAnimation, FluidAnimation, NeonFutureAnimation, PulseLineAnimation, PulseLineModern, PulseLineNeobrutalist, PulseRing, StaticRing, WatercolorAnimation } from '@hoosei/voxweave-avatars';
  1. Use the components in your application:
<AvatarWaveAnimation />
<BlobAnimation />
<AuroraAnimation />
<FluidAnimation />
<NeonFutureAnimation />

Available Animations

Voxweave Avatars includes a variety of animation styles:

AnimationDescription
BlobAnimationOrganic, fluid blob that responds to audio input
AuroraAnimationColorful waves inspired by aurora borealis
WatercolorAnimationSoft, watercolor-like fluid animation
NeonFutureAnimationFuturistic neon-style visualization
FluidAnimationSmooth, liquid-like motion
PulseLineModernModern audio waveform visualization
PulseLineAnimationClassic audio waveform display
PulseRingConcentric rings that pulse with audio
StaticRingSimple ring visualization
EtherealWaveAnimationGentle, ethereal wave patterns
AvatarWaveAnimationAvatar-centric wave visualization

Animation Props

All animations accept standard properties:

PropTypeDescription
sizenumberSize of the animation in pixels
isListeningbooleanWhether the animation should show active listening state
audioDataUint8Array | nullAudio frequency data for visualization
agentAudioDataUint8Array | nullAgent's audio data for response visualization
listeningColorsstring, stringGradient colors for listening state
notListeningColorsstring, stringGradient colors for inactive state
agentStatus'idle' | 'speaking' | 'listening' | 'thinking'Current status of the agent

Using with Voxweave React

When using with Voxweave React, simply pass the animation component:

import { Voxweave } from '@hoosei/voxweave-react'
import { FluidAnimation, PulseRing } from '@hoosei/voxweave-avatars'

function MyApp() {
  // For simple usage
  return (
    <Voxweave
      animation={FluidAnimation}
      // other props...
    />
  )
  
  // Or conditionally select an animation
  const selectAnimation = () => {
    return isMinimal ? PulseRing : FluidAnimation
  }
  
  return (
    <Voxweave
      animation={selectAnimation()}
      // other props...
    />
  )
}

Custom Animations

You can create custom animations by implementing the VoxweaveThreeJSProps interface:

import { VoxweaveThreeJSProps } from '@hoosei/voxweave-react'
import { Canvas } from '@react-three/fiber'

const MyCustomAnimation: React.FC<VoxweaveThreeJSProps> = ({
  size,
  isListening,
  audioData,
  listeningColors,
  notListeningColors
}) => {
  return (
    <Canvas style={{ width: size, height: size }}>
      {/* Your Three.js implementation */}
    </Canvas>
  )
}

// Then use it with Voxweave
<Voxweave animation={MyCustomAnimation} />

Contributing

We welcome contributions! Please read the CONTRIBUTING.md file for details.

Development

For local development:

# Clone the repository
git clone https://github.com/hoosei/voxweave.git

# Navigate to the avatars package
cd voxweave/packages/avatars

# Install dependencies
npm install

# Start development server
npm run dev

License

This project is proprietary software owned by Hoosei Limited. See the LICENSE.md file in the root directory for details.

Hoosei® is a registered trademark, No. UK00003747539 of Hoosei Limited, 10 Upper Grosvenor Road, Tunbridge Wells, England, TN1 2EP. Registered England & Wales Company No. 13834192.

For licensing inquiries or permissions, please contact Hoosei Limited.

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago