Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WavFile.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. WavFile.h - Records sound to a file
  4. Copyright (C) 2008 Nasca Octavian Paul
  5. Author: Nasca Octavian Paul
  6. Mark McCurry
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of version 2 of the GNU General Public License
  9. as published by the Free Software Foundation.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License (version 2) for more details.
  14. You should have received a copy of the GNU General Public License (version 2)
  15. along with this program; if not, write to the Free Software Foundation,
  16. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef WAVFILE_H
  19. #define WAVFILE_H
  20. #include <string>
  21. class WavFile
  22. {
  23. public:
  24. WavFile(std::string filename, int samplerate, int channels);
  25. ~WavFile();
  26. bool good() const;
  27. void writeMonoSamples(int nsmps, short int *smps);
  28. void writeStereoSamples(int nsmps, short int *smps);
  29. private:
  30. int sampleswritten;
  31. int samplerate;
  32. int channels;
  33. FILE *file;
  34. };
  35. #endif