1 /* 2 ZynAddSubFX - a software synthesizer 3 4 WavFile.h - Records sound to a file 5 Copyright (C) 2008 Nasca Octavian Paul 6 Author: Nasca Octavian Paul 7 Mark McCurry 8 9 This program is free software; you can redistribute it and/or 10 modify it under the terms of the GNU General Public License 11 as published by the Free Software Foundation; either version 2 12 of the License, or (at your option) any later version. 13 */ 14 15 #ifndef WAVFILE_H 16 #define WAVFILE_H 17 #include <string> 18 19 namespace zyn { 20 21 class WavFile 22 { 23 public: 24 WavFile(std::string filename, int samplerate, int channels); 25 ~WavFile(); 26 27 bool good() const; 28 29 void writeMonoSamples(int nsmps, short int *smps); 30 void writeStereoSamples(int nsmps, short int *smps); 31 32 private: 33 int sampleswritten; 34 int samplerate; 35 int channels; 36 FILE *file; 37 }; 38 39 } 40 41 #endif 42