MCPcopy Create free account
hub / github.com/HackerPoet/FractalSoundExplorer / WinAudio

Class WinAudio

WinAudio.h:9–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#undef max
8
9class WinAudio {
10public:
11 static const int NUM_AUDIO_BUFFS = 5;
12 static const int AUDIO_BUFF_SIZE = 4096;
13 static WinAudio* WIN_AUDIO;
14
15 struct Chunk {
16 int16_t* samples;
17 size_t sampleCount;
18 };
19
20 WinAudio(HWND handle, int sample_rate);
21 ~WinAudio();
22
23 bool play();
24 bool stop();
25 virtual bool onGetData(Chunk& data)=0;
26
27protected:
28 static void CALLBACK Callback(HWAVEOUT hWaveOut, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2);
29 void SubmitBuffer();
30
31 //Wave properties
32 HWAVEOUT m_HWaveOut;
33 HANDLE m_Mutex;
34 WAVEFORMATEX m_Format;
35 WAVEHDR m_WaveOutHdr[NUM_AUDIO_BUFFS];
36 int16_t m_WaveOut[NUM_AUDIO_BUFFS][AUDIO_BUFF_SIZE];
37 int m_CurWaveOut;
38 int m_SampleRate;
39 bool m_IsReleasing;
40};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected