Public
Like
Web-amp
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
index.ts
https://paulkinlan--3772dd3cb66b11f0bacb0224a6c84d84.web.val.run
A comprehensive web application that acts as a microphone amplifier using the Web Audio API with full device selection capabilities.
- Real-time microphone amplification - Captures audio from your microphone and amplifies it through your speakers
- Device selection - Choose specific input (microphone) and output (speakers/headphones) devices
- Adjustable gain control - Volume slider to control amplification level (0.1x to 5.0x)
- Visual audio level indicator - Real-time display of audio input levels with color coding
- Audio output testing - Test button to verify your speakers are working
- Device refresh - Reload available audio devices without refreshing the page
- Feedback protection warnings - Built-in warnings to help prevent audio feedback loops
- Clean, responsive UI - Dark theme with intuitive controls
- Debug information - Real-time display of audio context state and sample rate
- Load devices - The app automatically loads available microphones and speakers on startup
- Test audio output - Click "🔊 Test Audio Output" to verify your speakers work
- Select devices - Choose your preferred microphone and speakers from the dropdown menus
- Click "Start Amp" - The browser will request microphone permissions
- Grant microphone access - Allow the app to use your selected microphone
- Adjust amplification - Use the slider to control the volume boost
- Monitor levels - Watch the audio level indicator to avoid clipping
- Click "Stop Amp" - Stops the amplifier and releases the microphone
- Lists all available microphone inputs
- Shows device names when permissions are granted
- Fallback to "Default Microphone" if no specific device is selected
- Lists all available audio output devices
- Note: Output device selection support varies by browser
- Chrome and Edge have better support than Firefox/Safari
- Click "🔄 Refresh Devices" to reload the device list
- Useful when plugging/unplugging audio devices
- Automatically requests microphone permissions to get device labels
⚠️ Feedback Warning: This app can create audio feedback loops if your microphone picks up sound from your speakers. To prevent this:
- Use headphones instead of speakers when possible
- Start with low amplification levels
- Keep your microphone away from speakers
- Be prepared to quickly stop the amp if feedback occurs
- Uses the Web Audio API for real-time audio processing
- Uses MediaDevices.enumerateDevices() for device discovery
- Disables echo cancellation, noise suppression, and auto-gain control for pure amplification
- Includes real-time frequency analysis for the visual level indicator
- Attempts to use setSinkId() for output device selection (Chrome/Edge support)
- Responsive design works on desktop and mobile devices
Works in modern browsers that support:
- Web Audio API
- getUserMedia API
- MediaDevices.enumerateDevices API
- ES6+ JavaScript features
- Chrome/Edge: Full input and output device selection
- Firefox: Input device selection, limited output selection
- Safari: Input device selection, no output selection
- Mobile browsers: Limited device selection capabilities
- Visual feedback to monitor audio levels
- Easy stop button to quickly disable amplification
- Warning messages about potential feedback issues
- Automatic cleanup when the page is closed or refreshed
- Error handling for device access issues
- Graceful fallback when device selection is not supported