Sound in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Airslash
    New Member
    • Nov 2007
    • 221

    Sound in C++

    Hello,

    I know this will probably be something extremely difficult, but can anyone provide me with resources or links to resources that allow me to play sounds in C++ by using installed codecs on a given OS?

    I'd like to try avoid the use of external libs and maybe even write it myself in a very simple form. It's not to create a highend soundsystem, but just for a proof of concept.

    So I really hope someone can put me in the right direction as how to write in C++ code to play a soundfile without importing libs etc.
  • arnaudk
    Contributor
    • Sep 2007
    • 425

    #2
    Do you want to use the soundcard drivers to synthesize sounds, the MIDI interface, or "PC speaker"? Because these are all very different.

    Comment

    • Airslash
      New Member
      • Nov 2007
      • 221

      #3
      ideally I'd like to load a wave file and have it played on the host computer.

      Comment

      • Sick0Fant
        New Member
        • Feb 2008
        • 121

        #4
        Originally posted by Airslash
        ideally I'd like to load a wave file and have it played on the host computer.
        Reinventing the wheel, eh? You're in for more than you bargained for. This technology is not easy to write by yourself. Considering the lack of theoretical importance, why do you want to do this?

        Comment

        • oler1s
          Recognized Expert Contributor
          • Aug 2007
          • 671

          #5
          You'll want to be able to do two things. Read the WAV file properly, and use DirectSound.

          The WAV file specification is very open and well known. A bit of Googling will get you the standard as well as people's explanations for it.

          I'm assuming you're on Windows when I say DirectSound. Obviously, each OS has its own native sound mechanisms. Actually, there's no guarantee of that even.

          Comment

          • Airslash
            New Member
            • Nov 2007
            • 221

            #6
            Why I want to do this?
            I'm currently in my last year as student programming. And i'm writing a platform that allows the creation of multimedia applications, be it games, be it soundplayers or video players.

            So far i've used a dozen libraries all claiming that they're crossplatform, independant of this, independant of that.

            The truth however, is that each library used depends on several other libraries, that are either impossible to compile on a windows development environment, or are totally abandoned, or simply without decent manuals / explanations on how to use them.

            Hence the reason I want to write my platform in such a way that i'm not dependent on libraries, but that everything needed is in.


            and because it simply interests me :)

            Comment

            Working...