play music in C

hoda's Avatar, Join Date: Feb 2009
Go4Expert Member
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.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I can give you hint. You should use the beep function with needed frequency
0
mayjune's Avatar, Join Date: Jun 2009
Invasive contributor
i wouldn't really call that beep "music" to my ears ..
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
beep is the function which takes frequency as input
0
mayjune's Avatar, Join Date: Jun 2009
Invasive contributor
i know, i have heard it & thats why i said its nt really music to my ears....
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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?
0
naimish's Avatar
Banned
It won't be music I think, it will only an eratative sound, like beep, beep, and beep