This project is a web application that allows users to upload an audio file and visualize its sound waves using a grid of cells. The grid responds to the audio frequency data, changing the color of each cell based on the intensity of the sound waves. Users can play, pause, and upload different audio files to see the visualization.
- HTML5
- CSS3
- JavaScript
- Clone the repository to your local machine.
- Open the
index.html
file in a web browser.
- Ensured correct CSS styles for the grid container and cells.
- Dynamically created grid cells using JavaScript.
- Added an event listener to the file input for audio upload.
- Decoded the uploaded audio file using the Web Audio API.
- Used the AudioContext API to create an audio context and connect the audio source to an analyser node.
- Visualized the sound waves in the grid by analyzing the frequency data obtained from the analyser node.
- Implemented logic to stop previous audio playback before starting a new one.
- Checked the state of the audio context to prevent double playback.
- Ensured that the
visualizeSound
function was called during audio playback. - Updated the grid colors based on the intensity of the sound waves obtained from the analyser node.
- Added event listeners to the audio player for play and pause actions.
- Suspended and resumed the audio context to pause and resume audio playback and grid visualization.
- A fix for the issue of double instances of audio playback will be provided soon.
- Improve the visual representation of sound waves in the grid.
- Add additional features such as volume control and waveform display.
- Optimize performance for large audio files and grid sizes.