maddyblue / go-dsp

Digital Signal Processing for Go
http://godoc.org/github.com/mjibson/go-dsp
ISC License
847 stars 89 forks source link

float32 support (or: mismatch in APIs) #12

Closed hraban closed 9 years ago

hraban commented 9 years ago

The golang-users thread you announced this in suggests you used to have a float32 interface, but replaced it by float64, right? I'm asking because Im currently writing float32tofloat64 and float64tofloat32 array conversion routines and Im wondering why. The wav package produces float32s, but the other packages consume float64, which feels a little weird for two packages from the same repos.

I'm trying to tie it into some opus unit tests and libopus also works with float32, as I assume many others do.

Im curious to know: what made you drop float32?

maddyblue commented 9 years ago

I did not drop float32; it was never added. The wav package returns float32 because that's what a wav file contains (it can also return uint8 and int16, depending on the kind of data in the wav file). It was recommended (I think by Pike) to just have a duplicate package/API that accepts float32s. I never got around to making a script to automate that work, but it could happen.

hraban commented 9 years ago

Ah, right. Yeah it's not just your wav package; many audio libs work with float32. I only skimmed the google groups discussion, apologies for misunderstanding.

Anyway, I don't need it anymore, but it could be a nice addition to the API if it could consume its own data.

cheers