play music in C

Go4Expert Member
8Jul2009,14:30   #1
hoda's Avatar
Is it possible to write codes in c programming to play music when we run the program?
if the answer is yes can anybody write for me?
thenks.
Go4Expert Founder
8Jul2009,14:51   #2
shabbir's Avatar
I can give you hint. You should use the beep function with needed frequency
Invasive contributor
9Jul2009,21:16   #3
mayjune's Avatar
i wouldn't really call that beep "music" to my ears ..
Go4Expert Founder
9Jul2009,21:28   #4
shabbir's Avatar
beep is the function which takes frequency as input
Invasive contributor
9Jul2009,21:40   #5
mayjune's Avatar
i know, i have heard it & thats why i said its nt really music to my ears....
Mentor
10Jul2009,11:21   #6
xpi0t0s's Avatar
It's possible to play music in C yes but this is very platform dependent. What operating system are you using, what compiler (and version), and what kind of music do you want to play: do you want to play MIDI files using the standard sound card, do you want to play MP3 files, WAV files or similar, or do you want to synthesis the sounds yourself like a soft synth? Do you want the C program to be directly responsible for creating the sound or could you use C to create, for example, CSound input files then launch CSound to do the sound production?
Banned
10Jul2009,11:24   #7
naimish's Avatar
It won't be music I think, it will only an eratative sound, like beep, beep, and beep