OpenAL instead of DirectSound

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • OpenAL instead of DirectSound

      Hey guys,

      I am currently implementing the audio system of GCC4 for my OS X port. I will use OpenAL for sound playback but now I am a little bit unsure about an implementation detail.

      OpenAL has the concept of sources and buffers. A buffer holds sound data while one or more sources can play back the sound from that buffer. It seems to me that DirectSound has only the concept of buffers so in GCC4 creating a new object which can be played involves creating a new buffer. If I transfer that concept to OpenAL I would store an OpenAL buffer together with an OpenAl source and treat it as a single object..

      The problem with that is the amount of memory used because for every sound I want to play I would have to create another buffer even if I already had a buffer with the corresponding sound data. So my current idea is to put away the AudioBuffer and instead use something like an AudioSource which is created by an audio manager. This manager would hold a list of buffers identified with the name of the file from which they were initialized. This way the same sound data gets only loaded once into memory and the sources would get an handle to the buffer they want to play back. My problem with this design is that it seems to duplicate functionality from the resource cache (avoiding double loading) and somehow I am feeling uneasy about that. Any ideas or comments on that?

      Thanks a lot!
    • You should integrate OpenAL into your resource cache, as I understand it the 'buffers' are the processed audio data which is used by listeners to play back the audio, so it would make sense that this is the data which will not be duplicated, but instead pointed to by a 'SoundSource', you will need a class for the management of these soundsource's creation, modification, stopping etc.

      I too experimented with OpenAL and realized that it's not a very sturdy platform, if you want to go to Linux you have to use OpenALSoft, and I believe it is the same for Mac, also the base OpenAL has not been maintained by Crystal Labs, and is moving into a completely proprietary software.

      I would really suggest working with something like FMOD or irrKlang, unless you want to be an audio system programmer.
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • Originally posted by mholley519
      You should integrate OpenAL into your resource cache, as I understand it the 'buffers' are the processed audio data which is used by listeners to play back the audio, so it would make sense that this is the data which will not be duplicated, but instead pointed to by a 'SoundSource', you will need a class for the management of these soundsource's creation, modification, stopping etc.


      I thought about that but the buffers are managed by OpenAL so I will lose control over them...at least that is my understanding of the matter.

      I looked at Irrklang and while I really like the API there is no 64bit version and development looks quite slow. I will have to look at FMOD again but right now I finished the basic OpenAL implementation so I guess I will see how long this works ;)
    • I used irrKlang for the Orbito game I made, and it worked out pretty good, issues are

      - Yes, no 64 bit lib
      - Seems to break down with every new GCC release on Linux

      The plus side is the license cost is really low, and is free for non-commercial. The actual API itself was fantastic to work with.
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz