Playing sounds in Turbo C++
Hello, I am a sophomore in highschool. I am making battleship as my final project and I need some help. Would anyone be kind enough to tell me how(if possible) to play a .wav file? If that is not possible, is it possible to play a beep (the \a type) with a different frequency? If you need a special header file could you please post it? Thank you.
I'm not using Borland... but...
I'm pretty sure that the new Borland compiler has a
Sound(Frequency, Duration) function. The old one should have one too. Do you have a sound.h file? In true-DOS this would probably only work through the internal speaker
Microsoft has a Beep(Frequency, Duration) function. But, it does different things depending on your hardware and operating system. As I recall, it only works "as-expected" with WinNT or WinXP and only if you don't have a sound card/external speakers... Weird!
Those WINAPI sound functions that you found look like MIDI functions, which should work... if you can find the documentation... And if they are from the Turbo C++ compiler. If it's really a DOS compiler, it shouldn't have a windows.h file!