Sound Lib: SoundLib/Audio/IAudio.h ソースファイル

Sound Lib

Sound Lib
C/C++Windowsゲーム用音声再生ライブラリ
IAudio.h
1 //----------------------------------------------------------
2 // <filename>IAudio.h</filename>
3 // <author>Masami Sugao</author>
4 // <date>2018/07/16</date>
5 //----------------------------------------------------------
6 #ifndef IAUDIO_H
7 #define IAUDIO_H
8 
9 #include <windows.h>
10 #include <mmsystem.h>
11 #include <mmreg.h>
12 #include "../Common.h"
13 
14 
15 namespace SoundLib {
16 namespace Audio {
17 
21 class IAudio {
22 public:
23  /* Constructor / Destructor ------------------------------------------------------------------------- */
27  virtual ~IAudio() = default;
28 
29  /* Getters / Setters -------------------------------------------------------------------------------- */
34  virtual const WAVEFORMATEX* GetWaveFormatEx() const = 0;
35 
40  virtual std::string GetFormatName() const = 0;
41 
46  virtual int GetChannelCount() const = 0;
47 
52  virtual int GetSamplingRate()const = 0;
53 
58  virtual int GetBitsPerSample() const = 0;
59 
69  virtual bool HasReadToEnd() const = 0;
70 
71  /* Functions ---------------------------------------------------------------------------------------- */
77  virtual bool Load(std::string filePath) = 0;
78 
85  virtual long Read(BYTE* pBuffer, long bufSize) = 0;
86 
90  virtual void Reset() = 0;
91 };
92 
93 }
94 }
95 
96 #endif
virtual void Reset()=0
ファイルポインタを音声データの先頭に戻す。
virtual const WAVEFORMATEX * GetWaveFormatEx() const =0
PCMの情報を格納したオブジェクト
virtual ~IAudio()=default
デストラクタ
virtual int GetBitsPerSample() const =0
デコード前のビットレートを取得する。
virtual bool HasReadToEnd() const =0
ファイル末尾まで読み込みが終わったかどうかを示す値をを取得する。
オーディオファイルデコードクラス用インターフェース
Definition: IAudio.h:21
virtual bool Load(std::string filePath)=0
ファイルを解析し、デコード準備を行う。
Definition: CompressedAudio.cpp:13
virtual int GetChannelCount() const =0
デコード前のチャンネル数を取得する。
virtual std::string GetFormatName() const =0
ファイルフォーマットを示す文字列を取得する。
virtual long Read(BYTE *pBuffer, long bufSize)=0
ファイルを順次読み込み、デコードした値を格納する。
virtual int GetSamplingRate() const =0
デコード前のサンプリングレートを取得する。
構築:   doxygen 1.8.14