Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iang/react-music-visualiser
A simple React experiment that creates Visualisation from an audio source
https://github.com/iang/react-music-visualiser
Last synced: 2 days ago
JSON representation
A simple React experiment that creates Visualisation from an audio source
- Host: GitHub
- URL: https://github.com/iang/react-music-visualiser
- Owner: IanG
- Created: 2024-07-18T18:06:48.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-19T13:19:12.000Z (7 months ago)
- Last Synced: 2024-11-30T11:08:48.357Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-music-visualiser
A simple React experiment that creates Visualisation from an audio source using the [WEB Audio API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API). This example draws a very typical Spectrum Analyser visualisation. Once you have access to the frequency data you could render any visualisation you wish.
The experiment makes use of an [AnalyserNode](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode) object to set the [Fast Fourier transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) window size - 256 in this case. This size will dictate how many elements will be returned when the `getByteFrequencyData` method is called. Each element in the array represents an audio frequency (Hz) band and its decibel value (0-255). A HTML Canvas is then used to plot each frequencies value onto the screen as the audio plays.