DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   Game Development (http://www.daniweb.com/forums/forum71.html)
-   -   Using DirectSound w/o DXUT.h (http://www.daniweb.com/forums/thread121286.html)

CoolGamer48 Apr 27th, 2008 9:08 pm
Using DirectSound w/o DXUT.h
 
Hey,

So, I'm trying to learn DirectSound, and imagine my delight to learn that DirectSound doesn't have any interface for loading wave files! So MSDN refers me to the DXUT.h file that can be used to load .wav files and even to take care of some DirectSound stuff for you. Neato! Unfortunately, it requires a unicode build instead of multi-byte. Now I'm not exactly sure what that means, but all I know is I don't want to have to cast every string I have with (LPCWSTR).

So, is there some other interface that I can use with DirectSound to load .wav files (or some other sound file format), or some other API I can use all together (would prefer it if I didn't need to switch to a whole other API)? Basically just looking for advice on what's best for playing sounds.

MattEvans Apr 27th, 2008 11:29 pm
Re: Using DirectSound w/o DXUT.h
 
Probably not what you want to hear, but the multiplatform SDL library ( simple directmedia layer ) has routines for loading in Wav files. I'm not sure how it holds the data internally, since SDL has its own playback routines aswell, but worth a look maybe.

I never work with platform-specific libs directly, so I can't really help you much more there. Have you looked at the samples in the DX SDK directory though? There's a PlaySound demo, although that might be the technique you're already considering.

CoolGamer48 Apr 29th, 2008 9:24 am
Re: Using DirectSound w/o DXUT.h
 
Ehh... I may switch to another API if I can't figure this out.

I do believe the sample uses the file I was referring to. Does anyone know of any tutorials for DirectSound? I'm curious to see how they will do it. I may trying to switch to more open APIs like OpenGL, because the only real thing I use DirectX for is Direct3D. I do use DirectInput, but I can get key presses with GetAsyncKeyState() and I'm sure there's a way to get mouse input. DirectPlay is deprecated, and I can't really get DirectSound to work.

So anyway, any DirectSound tutorials appreciated.


All times are GMT -4. The time now is 1:38 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC