Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwmarcos committed Aug 11, 2021
1 parent ff0843e commit e88acbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# fft-audio-colors
analyze sounds with FFT to detect bass using brower AudioContext API

## how this works
1. Create a copy from original selected audio
2. Add some filters to this copy, this help to improve bass detection
3. use [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame) to change screen colors based on bass
4 changes: 1 addition & 3 deletions schetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,11 @@ function setup ({ audioCtx, player, filteredPlayer }) {
const analyser = FFTAnalyser({ audioCtx })
const filterAnalyser = FFTAnalyser({ audioCtx })

// connect filters
// connect filters and analyzsers
filteredSrc.connect(lowPassFilter)
lowPassFilter.connect(lowshelfFilter)
lowshelfFilter.connect(gain)
gain.connect(filterAnalyser)

// piping original audio with the audio output
src.connect(analyser)
analyser.connect(audioCtx.destination)

Expand Down

0 comments on commit e88acbe

Please sign in to comment.