Skip to content

Commit

Permalink
keep hanning window
Browse files Browse the repository at this point in the history
  • Loading branch information
BlinkyStitt committed Apr 27, 2024
1 parent d2fec9b commit ecee070
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions musical-leptos/src/components/dancing_lights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use musical_lights_core::{
},
lights::Gradient,
logging::{info, trace},
windows::FlatWindow,
windows::HanningWindow,
};
use wasm_bindgen::{closure::Closure, JsCast, JsValue};
use web_sys::{MediaStream, MediaStreamConstraints, MessageEvent};
Expand Down Expand Up @@ -56,8 +56,8 @@ pub fn DancingLights() -> impl IntoView {

let (sample_rate, set_sample_rate) = create_signal(None);

// TODO: change this to match the size of the light outputs
// let gradient = Gradient::<NUM_CHANNELS>::new_mermaid();
// TODO: use a signal for this so that we can change it real time
let gradient = Gradient::<NUM_CHANNELS>::new_rainbow(100.0, 70.0);

// // TODO: make this a signal so the user can change it?
Expand Down Expand Up @@ -97,13 +97,13 @@ pub fn DancingLights() -> impl IntoView {
// TODO: is combining signals like this okay?
set_sample_rate(Some(new_sample_rate));

// TODO: is this generic correct?
// TODO: what weighting?
let weighting = FlatWeighting;

let mut audio_buffer = AudioBuffer::<MIC_SAMPLES, FFT_INPUTS>::new();

let fft = FFT::<FFT_INPUTS, FFT_OUTPUTS>::new_with_window_and_weighting::<
FlatWindow<FFT_INPUTS>,
HanningWindow<FFT_INPUTS>,
_,
>(weighting);

Expand Down

0 comments on commit ecee070

Please sign in to comment.