https://claude.ai/public/artifacts/04b251dd-f000-4113-9da7-2e6ec663e6a4
I'll create a sound player that can load and play raw 8-bit PCM audio files in the browser.
I've created an 8-bit PCM audio player with the following features:
Features:
- File upload - Drag and drop or click to upload raw 8-bit PCM files
- Configurable sample rate - Set the sample rate (default 44100 Hz)
- Mono/Stereo support - Choose between 1 or 2 channels
- Playback controls - Play, pause, and stop buttons
- Seek bar - Click to jump to any position in the audio
- Volume control - Slider and mute button
- Time display - Current time and total duration
- Visual feedback - Animated waveform visualization
How it works:
- Upload your raw 8-bit PCM file (unsigned, 0-255 values)
- Set the correct sample rate and channel count for your file
- The player converts the 8-bit data to float32 format for the Web Audio API
- Use the controls to play, pause, seek, and adjust volume
The player assumes 8-bit unsigned PCM data where each byte represents one sample (0-255 maps to -1.0 to 1.0 in the audio buffer).
Audio files are available from :
https://github.com/johnsokol/AudioByte/tree/master/sound
No comments:
Post a Comment