The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: zemtex on February 01, 2011, 12:35:20 AM

Title: Direct Sound structures
Post by: zemtex on February 01, 2011, 12:35:20 AM
Howdy. (I am tempted to say, what would assembly be without this forum  :bdg)

I've created a IDirectSound8 interface, set cooperative level and now I am supposed to create a primary and secondary buffer.

My problem is not really a coding problem, but a decision problem. I am stuck at the creation of the primary buffer.

The DSBUFFERDESC and the lpwfxFormat section. I do not really understand what to choose, there are two options (WAVEFORMATEX or WAVEFORMATEXTENSIBLE)

Which should I choose, do anyone have a template for creating a "normal" variant to play common wave files. It is in my understanding that the C++ library already use templates, I couldnt locate any such templates in the include files. Anyone?
Title: Re: Direct Sound structures
Post by: dedndave on February 01, 2011, 01:09:15 AM
QuoteThe WAVEFORMATEXTENSIBLE structure defines the format of waveform-audio data for formats
having more than two channels or higher sample resolutions than allowed by WAVEFORMATEX.

judging from that, it sounds like the simpler structure would be sufficient in most cases
Title: Re: Direct Sound structures
Post by: japheth on February 01, 2011, 07:05:52 AM
Here's a sample with WAVEFORMATEX and how to read a .WAV file:

http://www.japheth.de/WinInc/DSound1.html

EDIT: this was post #1000!
Title: Re: Direct Sound structures
Post by: zemtex on February 01, 2011, 07:24:46 AM
Alright, but now that MS has dropped the hardware layer of directsound3d, i've been thinking about moving towards OpenAL. What is your opinion on that?
Title: Re: Direct Sound structures
Post by: japheth on February 01, 2011, 08:17:12 AM
Quote from: zemtex on February 01, 2011, 07:24:46 AM
Alright, but now that MS has dropped the hardware layer of directsound3d, i've been thinking about moving towards OpenAL. What is your opinion on that?

I have none (yet). However, depending on what you want to achieve you might also consider SDL.