Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

input_wav.hpp

Go to the documentation of this file.
00001 #ifndef INPUT_WAV_HPP
00002 #define INPUT_WAV_HPP
00003 
00004 
00005 #include "config.h"
00006 #include "input.hpp"
00007 #include "file.hpp"
00008 
00009 
00010 class WAVInputStream : public ISampleSource
00011 {
00012 public:
00013   WAVInputStream();
00014   ~WAVInputStream();
00015 
00016   bool Initialize(IFile* file);
00017 
00018   void GetFormat(
00019     int& channel_count,
00020     int& sample_rate,
00021     int& bits_per_sample);
00022   int Read(int sample_count, void* samples);
00023   bool Reset();
00024 
00025 private:
00026   bool FindFormatChunk();
00027   bool FindDataChunk();
00028   bool SkipBytes(int size);
00029 
00030 private:
00031   IFile* m_file;
00032 
00033   // from format chunk
00034   int m_channel_count;
00035   int m_bits_per_sample;
00036   int m_sample_rate;
00037 
00038   // from data chunk
00039   int m_data_chunk_location; // bytes
00040   int m_data_chunk_length;   // in samples
00041 
00042   int m_samples_left_in_chunk;
00043 };
00044 
00045 
00046 #endif

Generated at Mon Jun 10 02:55:12 2002 for audiere by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001