Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What libraries/how to play wav file on Windows32 in C?

What libraries for C do I need to play a wav file on a Win32 system?

And what is the code to use those libraries?

like image 929
Heb Avatar asked Dec 28 '22 07:12

Heb


1 Answers

Use the Win32 API: PlaySound

Include library: Winmm.lib
Header include: Mmsystem.h (include Windows.h)
Example:

PlaySound(TEXT("recycle.wav"), NULL, SND_FILENAME);
like image 158
Brian R. Bondy Avatar answered Jan 16 '23 09:01

Brian R. Bondy