//Music Media processing#include <mmsystem.h>//Library support for Winmm.libpragma comment (lib,"Winmm.lib")//It could be a dynamic library, plus lib.//first, PlaySound can only put WAV files//1. ExamplePlaySound (_t ("national anthem. Wav"), NULL, Snd_filename | Snd_loop |snd_async);//2. PrototypesBoolwinapiplaysounda (_in_opt_ LPCSTR pszsound,//file name_in_opt_ hmodule Hmod,//Load Mode_in_ DWORD Fdwsound//Playback Mode);//3. Playback modeSnd_filename//The specified WAV file is loadedSnd_resource//Resource LoadingSnd_sync//The PlaySound function does not end after playing synchronouslySnd_async//asynchronous playback, after the call is complete, PlaySound immediately returns, non-cloggingSnd_loop//loop play, must be combined with asynchronous playback//Second, mcisendstring//MCI Series functions (Media Control Interface), you can play most of the music files, such as MP3//1. ExamplemciSendString (_t ("Open See_you_again.mp3 type MPEGVideo alias MyMusic"), NULL,0, NULL); mciSendString (_t ("Play MyMusic Repeat"), NULL,0, NULL); mciSendString (_t ("Close MyMusic"), NULL,0, NULL);//2. PrototypesWinmmapimcierrorwinapimcisendstringw (_in_ lpcwstr lpstrcommand,_out_writes_opt_ (uReturnLength) LPWSTR Lpstrreturnstring,_in_ UINT ureturnlength,_in_opt_ HWND hwndcallback);
win32--Music Media Processing