Skip to content

ohyjek/clippis_tent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

109 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽͺ Clippi's Tent - Spatial Voice Chat

A desktop application prototype recreating Dolby Axon-style spatial voice chat functionality. Built with Electron, SolidJS, and Web Audio API.

Overview

Clippi's tent demonstrates spatial audio positioning where sound sources have virtual positions in a 2D room. The listener (you) can move around, and audio volume/panning adjusts based on:

  • Distance attenuation β€” Sounds get quieter as they move further away (linear, inverse, exponential models)
  • Stereo panning β€” Sounds pan left/right based on horizontal position relative to the listener
  • Directional audio β€” Speakers have directivity patterns (cardioid, omnidirectional, supercardioid, hypercardioid, figure8, hemisphere)
  • Wall occlusion β€” Sound attenuates when passing through room walls
  • Max distance cutoff β€” Configurable maximum hearing range with smooth falloff
  • Rear gain floor β€” Minimum audibility for sounds behind the listener

Features

The Tent β€” Spatial Audio Playground

  • Draw rooms by switching to draw mode and clicking/dragging
  • Multiple speakers with configurable directivity patterns and frequencies
  • Switch perspective β€” Double-click any speaker to "become" them
  • Real-time audio with test tones (oscillators) or microphone input
  • Visual feedback β€” Sound cones, gain bars, and optional sound path lines
  • Room boundaries with configurable wall attenuation

Settings

  • Configure audio devices (input/output)
  • Theme selection (light/dark/system)
  • Language preferences
  • Audio processing options (echo cancellation, noise suppression)

Tech Stack

Component Technology
Desktop Framework Electron 40
Build System Vite + Electron Forge
UI Framework SolidJS + @solidjs/router (lazy loading)
Styling CSS Modules + CSS Custom Properties
Audio Web Audio API (oscillators, stereo panner)
Testing Vitest + Playwright
Package Manager pnpm (workspace monorepo)

Getting Started

Prerequisites

  • Node.js 18+
  • pnpm (npm install -g pnpm)

Installation

# Clone the repository
git clone https://github.com/Omi/clippis_tent.git
cd clippis_tent

# Install dependencies
pnpm install

# Start development server
pnpm dev

Scripts

Command Description
pnpm dev Run in development mode with hot reload
pnpm build Package the app for distribution
pnpm make Build platform-specific installers
pnpm lint Run ESLint
pnpm lint:fix Run ESLint with auto-fix
pnpm typecheck TypeScript type checking
pnpm check Run both typecheck and lint
pnpm test Run all unit tests
pnpm test:watch Run tests in watch mode
pnpm test:ui Run UI component tests only
pnpm test:all Run unit tests + E2E tests
pnpm e2e Run Playwright E2E tests
pnpm e2e:ui Run E2E tests with interactive UI
pnpm e2e:headed Run E2E tests with visible browser
pnpm clean Remove build artifacts

Testing

The project has comprehensive test coverage:

  • Spatial audio library (src/lib/spatial-audio*.ts) β€” Distance, panning, directivity, and wall attenuation calculations
  • Custom hooks (src/lib/hooks/) β€” Room, speaker, audio playback, microphone, and drawing hooks
  • UI components (packages/ui/) β€” All components tested with @solidjs/testing-library
  • E2E tests (e2e/) β€” Critical user flows with Playwright
# Run all tests (275 unit tests)
pnpm test

# Run E2E tests (19 tests)
pnpm e2e

Architecture

This is a pnpm workspace monorepo with UI components and types extracted into reusable packages.

clippis_tent/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ ui/                           # @clippis/ui - Reusable UI component library
β”‚   β”‚   └── src/components/
β”‚   β”‚       β”œβ”€β”€ Button/               # Button with variants
β”‚   β”‚       β”œβ”€β”€ ColorSwatches/        # Color picker grid
β”‚   β”‚       β”œβ”€β”€ FormField/            # Input, dropdown, slider fields
β”‚   β”‚       β”œβ”€β”€ ItemList/             # Selectable list
β”‚   β”‚       β”œβ”€β”€ Panel/                # Card container
β”‚   β”‚       β”œβ”€β”€ Section/              # Card with title
β”‚   β”‚       β”œβ”€β”€ SelectField/          # Dropdown
β”‚   β”‚       β”œβ”€β”€ Slider/               # Range input
β”‚   β”‚       β”œβ”€β”€ Speaker/              # Draggable speaker with cone
β”‚   β”‚       β”œβ”€β”€ Tabs/                 # Tab navigation
β”‚   β”‚       β”œβ”€β”€ Toast/                # Notifications
β”‚   β”‚       β”œβ”€β”€ Toggle/               # Checkbox with description
β”‚   β”‚       └── ErrorBoundary/        # Error boundary
β”‚   └── types/                        # @clippis/types - Shared TypeScript types
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.ts                       # Electron main process
β”‚   β”œβ”€β”€ preload.ts                    # Preload script for IPC
β”‚   β”œβ”€β”€ renderer.tsx                  # App entry with lazy-loaded routes
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ui/                       # App-specific UI wrappers
β”‚   β”‚   β”œβ”€β”€ audio/                    # Audio components
β”‚   β”‚   β”‚   └── FullDemo/             # Main spatial audio playground
β”‚   β”‚   β”‚       β”œβ”€β”€ context/          # SolidJS context (composes hooks)
β”‚   β”‚   β”‚       β”œβ”€β”€ components/       # Modular sub-components
β”‚   β”‚   β”‚       β”œβ”€β”€ constants.ts
β”‚   β”‚   β”‚       └── utils.ts
β”‚   β”‚   └── layout/                   # Layout components
β”‚   β”œβ”€β”€ pages/                        # Route pages (lazy-loaded)
β”‚   β”‚   β”œβ”€β”€ Tent.tsx                  # The Tent - spatial audio playground
β”‚   β”‚   └── Settings.tsx              # Audio settings page
β”‚   β”œβ”€β”€ stores/                       # Global state (SolidJS signals)
β”‚   β”œβ”€β”€ lib/                          # Core libraries
β”‚   β”‚   β”œβ”€β”€ spatial-audio.ts          # Spatial audio math utilities
β”‚   β”‚   β”œβ”€β”€ spatial-audio-engine.ts   # Advanced audio engine
β”‚   β”‚   β”œβ”€β”€ hooks/                    # Reusable SolidJS hooks
β”‚   β”‚   β”‚   β”œβ”€β”€ useAudioPlayback.ts   # Audio node lifecycle
β”‚   β”‚   β”‚   β”œβ”€β”€ useMicrophone.ts      # Microphone access
β”‚   β”‚   β”‚   β”œβ”€β”€ useRoomManager.ts     # Room CRUD
β”‚   β”‚   β”‚   β”œβ”€β”€ useSpeakerManager.ts  # Speaker CRUD + perspective
β”‚   β”‚   β”‚   β”œβ”€β”€ useCanvasDrawing.ts   # Draw mode interactions
β”‚   β”‚   β”‚   └── useDragHandler.ts     # Drag/rotate interactions
β”‚   β”‚   └── i18n.tsx                  # Localization
β”‚   └── locales/                      # Translation files
└── docs/
    └── TECHNICAL_ROADMAP.md          # Development roadmap & HRTF plan

Spatial Audio Model

The spatial audio system uses a 2D model with advanced features:

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚                         β”‚
                    β”‚    🎀 Sound Source      β”‚
                    β”‚     position, facing    β”‚
                    β”‚     directivity pattern β”‚
                    β”‚           β”‚             β”‚
                    β”‚    distance + walls     β”‚
                    β”‚    + directivity        β”‚
                    β”‚           β”‚             β”‚
                    β”‚           β–Ό             β”‚
                    β”‚    🎧 Listener (You)    β”‚
                    β”‚     position, facing    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Volume = distanceAttenuation Γ— directivityGain Γ— listenerDirectionalGain Γ— wallOcclusion Γ— masterVolume
Pan    = calculateStereoPan(listener, source, listenerFacing)

Roadmap

See docs/TECHNICAL_ROADMAP.md for the detailed technical roadmap.

βœ… Phase 1: Foundation (Complete)

  • Electron + SolidJS + Vite setup
  • UI library extraction to @clippis/ui package
  • Spatial audio engine with distance models and directivity patterns
  • Interactive room drawing with wall occlusion
  • Multiple speakers with configurable properties
  • Perspective switching (become any speaker)
  • Modular component architecture with SolidJS Context and hooks
  • Comprehensive test coverage (275 unit + 19 E2E)

πŸ”„ Phase 2: Voice Integration (In Progress)

  • Microphone input capture with permissions
  • Audio source switching (oscillator/microphone)
  • Voice activity detection (VAD)
  • Push-to-talk mode
  • Audio level meters / visualizers

πŸ“‹ Phase 3: Advanced Audio (Planned)

  • HRTF β€” Migrate from StereoPanner to PannerNode for true 3D audio
  • Room acoustics β€” Reverb and early reflections
  • Audio quality settings β€” Bitrate, sample rate options

πŸ“‹ Phase 4: Multiplayer (Future)

  • WebRTC peer-to-peer connections
  • Signaling server for room coordination
  • User avatars with position sync
  • Proximity-based audio routing

License

MIT

About

A desktop application prototype recreating Dolby Axon-style spatial voice chat functionality. Built with Electron, SolidJS, and Web Audio API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors