VS里面
WINMMAPI BOOL WINAPI PlaySoundA( __in_opt LPCSTR pszSound, __in_opt HMODULE hmod, __in DWORD fdwSound);
WINMMAPI BOOL WINAPI PlaySoundW( __in_opt LPCWSTR pszSound, __in_opt HMODULE hmod, __in DWORD fdwSound);
#ifdef UNICODE
#define PlaySound PlaySoundW
#else
#define PlaySound PlaySoundA
#endif // !UNICODE
PlaySound 可以直接播放内存中的语音!
QT中我找到的函数是播放文件:
<PRE cpp? brush:>QSound::play("mysounds/bells.wav");