1 /******************************************************************************/
2 /* Mednafen - Multi-system Emulator                                           */
3 /******************************************************************************/
4 /* WAVRecord.h:
5 **  Copyright (C) 2010-2016 Mednafen Team
6 **
7 ** This program is free software; you can redistribute it and/or
8 ** modify it under the terms of the GNU General Public License
9 ** as published by the Free Software Foundation; either version 2
10 ** of the License, or (at your option) any later version.
11 **
12 ** This program is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ** GNU General Public License for more details.
16 **
17 ** You should have received a copy of the GNU General Public License
18 ** along with this program; if not, write to the Free Software Foundation, Inc.,
19 ** 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 */
21 
22 #ifndef __MDFN_WAVRECORD_H
23 #define __MDFN_WAVRECORD_H
24 
25 #include <mednafen/mednafen.h>
26 #include <mednafen/FileStream.h>
27 
28 namespace Mednafen
29 {
30 
31 class WAVRecord
32 {
33  public:
34 
35  WAVRecord(const char *path, double SoundRate, uint32 SoundChan);
36 
37  void WriteSound(const int16 *SoundBuf, uint32 NumSoundFrames);
38 
39  void Finish();
40 
41  ~WAVRecord();
42 
43  private:
44 
45  FileStream wavfile;
46  bool Finished;
47 
48  uint8 raw_headers[0x2C];
49  int64 PCMBytesWritten;
50  uint32 SoundRate;
51  uint32 SoundChan;
52 };
53 
54 }
55 #endif
56