WinAudio is a library for audio playback on Windows 7 and later. This project was born from the passion for music and programming. Developed as a hobby on weekends and after work.
The output is based on WASAPI in Shared Mode. Stream switch is supported.
The decoding of compressed audio files is based on Media Foundation. Currently supported MP3, and WMA. The decoding of PCM WAV files is done by a specially written module.
The project was developed with Visual Studio 2019. So just open the WinAudio.sln file to start editing and compiling the code.
The supported platform is currently x86. No tests have been done on the X64 platform.
The project is currently sufficiently complete and stable, but It is not yet complete and the code or structure may change in the future.
Include "WinAudio.h" in your project
#include <stdint.h>
#include "..\WinAudio\WinAudio.h"
int main()
{
WinAudio_Handle* pHandle;
int32_t nErrorCode = 0;
// Create new WinAudio Instance
pHandle = WinAudio_New(WINAUDIO_WASAPI, &nErrorCode);
// Try to open a new File
nErrorCode = WinAudio_OpenFile(pHandle, pFilePath);
// Try to Play
nErrorCode = WinAudio_Play(pHandle);
// Remember to Check for Errors...
// Close WinAudio Instance
WinAudio_Delete(pHandle);
return 0;
}