UtiLite  0.2.14
A lite utilities library
audio/include/utilite/UAudioRecorderFile.h
Go to the documentation of this file.
00001 
00007 #ifndef UFILEAUDIORECORDER_H
00008 #define UFILEAUDIORECORDER_H
00009 
00010 #include "utilite/UtiLiteExp.h" // DLL export/import defines
00011 
00012 #include "utilite/UAudioRecorder.h"
00013 #include <string>
00014 
00015 namespace FMOD
00016 {
00017 class Sound;
00018 class Channel;
00019 }
00020 
00044 class UTILITE_EXP UAudioRecorderFile : public UAudioRecorder
00045 {
00046 public:
00047     UAudioRecorderFile(const std::string &fileName, 
00048                  bool playSoundWhileRecording = false,
00049                                  int frameLength = 1024);
00050 
00051     virtual ~UAudioRecorderFile();
00052 
00053     const std::string &getFileName() const {return _fileName;}
00054 
00055     virtual bool init();
00056     virtual void close();
00057 
00058 protected:
00059     virtual void mainLoopBegin();
00060     virtual void mainLoop();
00061     virtual void mainLoopEnd();
00062 
00063 private:
00064     std::string _fileName;
00065     FMOD::Sound * _sound;
00066     unsigned int _soundLength;
00067 
00068     bool _playSoundWhileRecording;
00069     unsigned int _dataLength;
00070         unsigned int _lastRecordPos;
00071         FMOD::Channel * _channel;
00072 };
00073 
00074 #endif
 All Classes Files Functions Variables Enumerations Friends Defines