faiface / beep

A little package that brings sound to any Go application. Suitable for playback and audio-processing.
MIT License
2.03k stars 150 forks source link

Parametric equalizer #124

Closed cswank closed 2 years ago

cswank commented 3 years ago

based on https://octovoid.com/2017/11/04/coding-a-parametric-equalizer-for-audio-applications/

faiface commented 3 years ago

This looks cool! @dusk125 will do a proper review, here's just a quick note from me: I see you're returning an *Equalizer struct who's only methods are the ones of the Streamer interface. In such cases, I think it's better to make the Equalizer struct unexported and simply return an opaque Streamer value.

cswank commented 3 years ago

@faiface sounds good, I made those changes.

faiface commented 3 years ago

One more note: I see you use fs float64 to denote the sample frequency. The rest of Beep uses beep.SampleRate, so I think it would be better to use it here as well.

cswank commented 3 years ago

@faiface and @dusk125 I just pushed that change. Also, I have one more commit ready that implements an (optional) stereo equalizer. Would you rather take a look at the code as it is now before I push the stereo change? Stereo makes the code more complicated so maybe it would be good to verify the functionality in mono first.

cswank commented 3 years ago

Never mind, I'm going to push the stereo change because I'm about to be driving for 2 days.

dusk125 commented 3 years ago

Sounds good! That'll give me some time to review and wrap my head around this! Safe travels!

cswank commented 3 years ago

Thanks!