Wave Arts VQE  1.00
Voice Quality Enhancement
AiffFileIO.h
Go to the documentation of this file.
00001 /*
00002  * This file is part of the Wave Arts VQE library.
00003  * Copyright (C) 2011 Wave Arts, Inc. (http://wavearts.com)
00004  *
00005  * VQE is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * VQE is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * A copy of the GNU General Public License is included with VQE,
00016  * and can be found online at <http://www.gnu.org/licenses/>.
00017  *
00018  * If you'd like to distribute a closed-source product which uses VQE,
00019  * you must obtain a commercial VQE license from Wave Arts.
00020  */
00021 //
00022 // AIFF file I/O class header file.
00023 //
00024 // Bill Gardner, March, 1998.
00025 //
00026 
00027 
00040 
00041 
00042 #ifndef _AIFFFILEIO_H
00043 #define _AIFFFILEIO_H
00044 
00045 #include "AFileIO.h"
00046 #include "WaAIFF.h"
00047 
00052 class AiffFileIn : public AFileIn {
00053 protected:
00054         int numChannels;        
00055         int numBitsPerSamp;     
00056         int sampSize;           
00057         int frameSize;          
00058         long sampRate;          
00059         long numFrames;         
00060         long curFrameIndex;     
00061         HAiff hAiff;            
00062 
00064         bool Parse();
00066         bool CheckAudioFormat();
00067 
00068 public:
00073         AiffFileIn(long cvtBufSizeArg = 2048);
00074         ~AiffFileIn();
00075         bool Open(char *fileName);
00076         long GetNumFrames();
00077         int GetNumChannels();
00078         int GetBitsPerSamp();
00079         int GetSampSize();
00080         int GetFrameSize();
00081         long GetSampRate();
00083         long Tell();
00084         long Read(char *buf, long numBytes);
00085         long ReadShortFrames(short *buf, long numFrames);
00086         long ReadFloatFrames(float *buf, long numFrames);
00087         bool Seek(long frameOffset, int origin);
00088         bool Close();
00089 };
00090 
00095 class AiffFileOut : public AFileOut {
00096 protected:
00097         int numChannels;        
00098         int numBitsPerSamp;     
00099         int sampSize;           
00100         int frameSize;          
00101         long sampRate;          
00102         HAiff hAiff;            
00103         CkInfo ckFORM;          
00104         CkInfo ckCOMM;          
00105         CkInfo ckSSND;          
00106 
00107 public:
00112         AiffFileOut(long cvtBufFileSize = 2048);
00113         ~AiffFileOut();
00114         bool Open(char *fileName, long sampleRate, int sampleSize, int numChannels);
00115         int GetNumChannels();
00116         int GetBitsPerSamp();
00117         int GetSampSize();
00118         int GetFrameSize();
00119         long GetSampRate();
00121         long Tell();
00122         long Write(char *buf, long numBytes);
00123         long WriteShortFrames(short *buf, long numFrames);
00124         long WriteFloatFrames(float *buf, long numFrames);
00125         bool Close();
00126 };
00127 
00128 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines