play music in C

Discussion in 'C' started by hoda, Jul 8, 2009.

  1. hoda

    hoda New Member

    Joined:
    Feb 17, 2009
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    I can give you hint. You should use the beep function with needed frequency
     
  3. mayjune

    mayjune New Member

    Joined:
    Jun 14, 2009
    Messages:
    814
    Likes Received:
    33
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Pune,Delhi
    i wouldn't really call that beep "music" to my ears .. :p
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    beep is the function which takes frequency as input
     
  5. mayjune

    mayjune New Member

    Joined:
    Jun 14, 2009
    Messages:
    814
    Likes Received:
    33
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Pune,Delhi
    i know, i have heard it & thats why i said its nt really music to my ears....
     
  6. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    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?
     
  7. naimish

    naimish New Member

    Joined:
    Jun 29, 2009
    Messages:
    1,043
    Likes Received:
    18
    Trophy Points:
    0
    Occupation:
    Software Engineer
    Location:
    On Earth
    It won't be music I think, it will only an eratative sound, like beep, beep, and beep
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice