#include "AudioSample.h" #include "AudioSynth.h" #include "AudioWriter.h" #include "WasapiInterface.h" #include "TestCase.h" #include "TestCaseRunner.h" #include #include #ifdef _WIN32 #include #endif #include class TestWriteWav : public TestCase { public: bool Run() override { AudioWriter writer; writer.SetPath("test.wav"); AudioSynth synth; auto sample = synth.GetSineWave(240, 5); writer.Write(sample); return true; } }; class TestAudioRender : public TestCase { public: bool Run() override { #ifdef _WIN32 WasapiInterface audio_interface; auto device = AudioDevice::Create(); audio_interface.Play(device); #endif return true; } }; //int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) int main() { #ifdef _WIN32 CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); #endif std::cout << "into entry point" << std::endl; TestCaseRunner runner; //runner.AddTestCase("TestWriteNav", std::make_unique()); runner.AddTestCase("TestAudioRender", std::make_unique()); const auto testsPassed = runner.Run(); return testsPassed ? 0 : -1; #ifdef _WIN32 CoUninitialize(); #endif }