![]() |
IET | ![]() |
|
search :
help :
home
|
||
|
Latest News:
|
|
|


|
Topic Title: GRAPHICS PROGRAMMING IN C LANGUAGE Topic Summary: PROB IN ADDING SONG Created On: 15 July 2011 02:43 PM Status: Post and Reply |
Linear : Threading : Single : Branch |
Search Topic |
Topic Tools
|
|
|
|
|
Actually I am creating a HOTEL MANAGEMENT PROJECT IN C LANGUAGE (GRAPHICALY) in which..................
I am having problem to understand that how to add song in it (is it possible in c language or not?) ............................... Also in adding sound having problem to understand its working through frequency variation ............... could any one help me to understand it?[/I] |
|
|
|
|
|
|
|
|
Audio is tricky in C language; by default, most IDE systems have no include files or header files to let programmers incorporate music easily. The only one I know of is Visual Studio, where you can invoke the PlaySound() to play WAV files like so:
#include <windows.h> // for PlaySound() #define SND_FILENAME 0x20000 #define SND_LOOP 8 #define SND_ASYNC 1 using namespace std; int main() { // play sound as loop (remove SND_LOOP for one time play) // file boing.wav has be in the working directory PlaySound("song.wav",NULL,SND_FILENAME|SND_LOOP|SND_ASYNC); cin.get(); // wait return 0; } Otherwise, you may have to look for an open-source audio playback library. ------------------------- Technology: something that's hated & cursed at by all engineers, technologists & technicians! ( Lousy modern technology! |
|
|
|
|
|
|
|
|
Well that's actually the Windows API doing that, not Visual Studio. You could write the same thing in Notepad, push it through the compiler and get the same result.
But yes, working with sound is difficult. I have recently implemented MP3/Ogg Vorbis playback using the OpenAL library, with tutorials I have found via Google. You may wish to do the same. |
|
|
|
|
|
IET
» Information technology
»
GRAPHICS PROGRAMMING IN C LANGUAGE
|
Topic Tools |
FuseTalk Standard Edition v3.2 - © 1999-2013 FuseTalk Inc. All rights reserved.