>>  Site Map >>  Forums >>  C/C++/C#

Forum module - topics in forum:



C/C++/C# - Ngôn ngữ lập trình cục mạnh, cho các phần mềm trên máy



[VC++] Play a .WAV file

[VC++] Play a .WAV file
Chúng ta có thể làm chương trình chơi một file .wav với 3 bước sau :
1. Linker WINMM.LIB vào project :

Chọn tùy chọn Setting từ trình đơn Project , chọn tab Link chọn General từ hộp danh sách Category và thêm WINMM.LIB vào text box Object/Library Modules .



2. Include header file #include <mmsystem.h>vào source.

3.Chơi file .wav bằng lời gọi hàm :

PHP Code:
PlaySound("C:\\WINDOWS\\Media\\Windows XP Startup.wav", NULL, SND_FILENAME);




Re: [VC++] Play a .WAV file

Re: [VC++] Play a .WAV file
Đối với VS2k5 , bấm Alt F7 để gọi Property Pages , bấm chọn Linker,chọn Command Line từ danh sách sổ xuống ,thêm WINMM.LIB vào text box Additional options .Click OK.



Include header file #include <MMsystem.h>vào source.

Chơi file .wav bằng lời gọi hàm :

PHP Code:
PlaySound(TEXT("C:\\WINDOWS\\Media\\Windows XP Startup.wav"), NULL, SND_FILENAME);




Search from ALEXA


put your ads here