Commit Graph

13 Commits

Author SHA1 Message Date
tyrolyean 664f8d0305
Make fft work, add sample rate to stabilize waveform
This adds a sliding window buffer approach to the audio sample data as well as
force the user to set the sampling rate of the input data. This was needed to
stabilize fft output to a usable degree. Also the fft output is now in db, which
makes it a lot better to look at.

Signed-off-by: tyrolyean <tyrolyean@tyrolyean.net>
2022-07-20 23:43:41 +02:00
David Oberhollenzer b519a77ad9 Hack up audio fft with libfftw3
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-19 22:37:09 +02:00
David Oberhollenzer f3bf686a52 Read 32 bit float audio PCM samples from stdin
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-19 22:10:23 +02:00
David Oberhollenzer 770deae6cd Force blocking stdout
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-19 21:54:39 +02:00
David Oberhollenzer 8c47f2726c Implement sound buffer texture
Texture channel 0 has a 512x2 texture with audio samples. For now,
fill it with dummy data (ascending slope), so we can see some
output.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-19 21:54:39 +02:00
David Oberhollenzer 542669ef04 Minor fixes
- Fix uniform name for iFrame
 - Move timer initialization to main loop, so we don't measure
   the FBO initialization

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-19 21:06:06 +02:00
David Oberhollenzer 22b2fd4864 Keep global state clean
Unbind the FBO+texture after initialization, bind it before
rendering, unbind it after, re-bind the texture to scrape the
data, unbind the texture.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-19 21:04:43 +02:00
David Oberhollenzer 6bfa914582 Stop if shader compilation fails
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-19 20:58:32 +02:00
David Oberhollenzer e58028ae18 Do not mix debug prints and stdout data stream
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-19 20:57:12 +02:00
David Oberhollenzer 13e1363e0b Add license boilerplate
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-17 15:58:53 +02:00
David Oberhollenzer f21ecc71c7 Make the window invisible if dumping to stdout
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-17 03:25:37 +02:00
David Oberhollenzer 75baf054e5 Implement "dump raw frame buffer to stdout"
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-17 01:58:46 +02:00
David Oberhollenzer acaef93bd8 Initial commit
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2022-07-16 22:13:49 +02:00