| | |
How to code a program that can play sound
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
C++ Syntax (Toggle Plain Text)
#include <stdmagic> using namespace std; int main() { magically_do_something_platform_and_implementation_specific(PLAY_MUSIC, "hello.mpg"); }
I'm here to prove you wrong.
Not quite ZZ Top but it's a start!
The Windows Api has a little thing called Beep(), try it ...
There are nicer things like sound(), that use the sound chip and midi voices. A little tough for C++. If you want to test it, get BCX free from:
http://www.rjpcomputing.com/programm.../devsuite.html
get used to BCXDX and learn to fly with sound and graphics! There are lots of sample files. This goes beyond the usual boring calculator and employee database stuff! You are still learning C/C++ though.
The Windows Api has a little thing called Beep(), try it ...
C++ Syntax (Toggle Plain Text)
// simple sounds via Beep(frequency_hrz, duration_ms) #include <iostream> #include <windows.h> // WinApi header file using namespace std; int main(int argc, char *argv[]) { Beep(523.2511,500); // 523.2511 hertz (C5) for 500 milliseconds Beep(587.3295,500); Beep(659.2551,500); Beep(698.4565,500); Beep(783.9909,500); cin.get(); // wait return 0; }
http://www.rjpcomputing.com/programm.../devsuite.html
get used to BCXDX and learn to fly with sound and graphics! There are lots of sample files. This goes beyond the usual boring calculator and employee database stuff! You are still learning C/C++ though.
May 'the Google' be with you!
![]() |
Similar Threads
- Read a raw PCM file and then play it (with sound) in C or C++ (C)
- Play a .wav file (Java)
- How to play sound through stereo speakers (C)
- adding sound (Visual Basic 4 / 5 / 6)
Other Threads in the C++ Forum
- Previous Thread: Im new
- Next Thread: Cant execute a c++ program
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






