Skip to content

tedsecretsource/sound-recorder

Repository files navigation

Sound Recorder

This is a sound recording application created in ReactJS. It is a learning exercise. Buyer beware.

This is, in many ways, a recreation of this dictaphone web application. However, with this version, I plan on making it a PWA so you can install it on your device and use it without an Internet connection.

Product Vision

I am a bit of a sound effects enthusiast. I have a small collection of sound effects and used to use a very nice Roland stereo recording device but it can sometimes be a burden to carry around. The feature I liked the most about it was its reliability. It was always ready to go and I could record a sound effect in a matter of seconds. I wanted to create a similar experience for myself.

The main feature of this application will be reliability. Once installed, you tap it to open it and tap the record button to start recording immediately. My plan is to save the recording every second so that should the app crash or you accidentally close it, you will not lose your recording.

Features

Recording

  • Record audio from device microphone with real-time waveform visualization
  • Quality presets: Voice (22.05kHz mono 64kbps), Music (44.1kHz stereo 128kbps), Hi-Fi (48kHz stereo 320kbps), and Custom
  • Gain boost toggle (1x / 7x amplification)
  • Reverb effect toggle
  • Recording persists during tab navigation
  • File size estimation based on selected quality settings
  • Supports WebM/Opus (Chrome, Firefox, Edge) and MP4/AAC (Safari)

Recording Management

  • Play, rename, and delete recordings
  • Add descriptions and categories (Broad Sound Taxonomy)
  • Recordings listed in reverse chronological order with quality badges and sync status indicators

Freesound.org Sync

  • OAuth2 authentication with Freesound
  • Upload recordings to your Freesound account (auto-converts to WAV)
  • Download sounds tagged sound-recorder-sync from your account
  • Edit name/description on approved sounds and push changes to Freesound
  • Track moderation status (Processing, In Moderation, Approved, Failed)
  • Cross-device sync — recordings uploaded on one device appear on others
  • Rate limit handling with automatic backoff and retry

Offline & PWA

  • Install as a standalone app on any device
  • Full offline support — record, edit, and manage without internet
  • Background sync queues uploads for when connectivity returns
  • Service worker with asset precaching for offline-first experience
  • Online/offline status indicator

Navigation

  • Record — recording interface with visualizer
  • Recordings — manage all local and synced recordings
  • Settings — quality presets and advanced audio configuration
  • User — Freesound account connection and profile info

Live Demo

You can see a live demo here of the current development version.

Audio Formats

Recording Format

The app records in the browser's native format:

  • WebM/Opus (audio/webm;codecs="opus") - Chrome, Firefox, Edge
  • MP4/AAC (audio/mp4) - Safari fallback

See src/hooks/useGetMediaRecorder.ts for implementation.

Freesound Upload Format

When syncing to Freesound, recordings are converted from WebM/Opus to WAV (16-bit PCM) before upload. See src/utils/audioConverter.ts.

Why WAV instead of uploading WebM directly?

  • Freesound officially supports: WAV, FLAC, OGG, MP3, AIFF
  • WebM is not officially listed as supported
  • WAV is universally accepted and avoids potential compatibility issues

Trade-offs of WAV conversion:

  • Larger file size (uncompressed PCM vs compressed Opus)
  • Lossy conversion (Opus → PCM is a decode, not a transcode)
  • More processing time on client

Future consideration: Freesound also accepts OGG, which uses the same Opus codec as WebM. A WebM → OGG conversion would be a lossless container change (same audio data, different wrapper). However, browsers don't provide a native API for this conversion. Libraries like FFmpeg.wasm could enable this but would add significant bundle size. For now, WAV conversion is simpler and guaranteed to work.

Freesound Sync

The app supports bidirectional sync with Freesound:

  • Upload — local recordings are uploaded to your Freesound account
  • Download — remote sounds tagged sound-recorder-sync are downloaded to the app

Authentication

Freesound sync uses OAuth 2.0. Because Freesound's OAuth flow requires a server-side token exchange, requests are proxied through a lightweight Cloudflare Worker.

Required Environment Variables

Variable Description
REACT_APP_FREESOUND_CLIENT_ID Your Freesound API client ID
REACT_APP_FREESOUND_OAUTH_PROXY_URL URL of the OAuth proxy worker

See .env.example for reference.

Resources

Other Related Repos

Reported Issues

These are issues I reported / uncovered / contributed to while working on this project.

About

Sound Recording device as a PWA made with ReactJS

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors