SABuffer.h 454 B

123456789101112131415161718192021222324
  1. #ifndef NULLSOFT_WINAMP_SA_BUFFER_H
  2. #define NULLSOFT_WINAMP_SA_BUFFER_H
  3. #define SABUFFER_WINDOW_INCREMENT 256
  4. class SABuffer
  5. {
  6. public:
  7. SABuffer();
  8. void WindowToFFTBuffer(float *wavetrum);
  9. unsigned int AddToBuffer(char *samples, int numChannels, int bps, int ts, unsigned int numSamples);
  10. bool Full() { return used == 512; }
  11. void CopyHalf();
  12. void Clear();
  13. private:
  14. float buffer[2][512];
  15. float window[512];
  16. size_t used;
  17. bool init;
  18. };
  19. #endif