![]() |
| [[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]] |
|
|
#1 |
|
Valued Member
Join Date: Jul 2005
Posts: 117
|
Hello,
Earlier today I decided to take a crack at DirectX Audio, more specifically, DirectSound. Some very low level stuff but I figured after I read some documentation on it carefully I could get it up and running in no time. However, this isn't the case for me here. I get tons of compiling errors and most of them are in dsound.h so I figured it isn't me. The type of errors I get include syntax, missing-storage type(LPCWAVEFORMATEX), and all that jazz. At first, I suspected it had something to do with defining INITGUID but I already did that weeks ago because I was using DirectX Input8. So I tried the alternative by linking to dxguid.lib and the errors are still there. It's strange how Direct3D doesn't need this crap. Also, it's weird how the object creation function in DirectSound is DirectSoundCreate8 and in DirectInput it's DirectInput8Create. You would think that the naming conventions between the APIs were consistent. I guess the API designers....aren't good API designers ![]()
___________________________________________
"God is dead." -- Nietsche "Nietsche is dead" -- God |
|
|
|
|
|
#2 |
|
DevMaster Staff
Join Date: Sep 2003
Location: Hell
Posts: 1,109
|
Try including windows.h before dsound.h. IIRC that was the fix to this problem.
|
|
|
|
|
|
#3 |
|
Valued Member
Join Date: Jul 2005
Posts: 117
|
Nevermind, I forgot to define DIRECTSOUND_VERSION. It compiles fine now. I'm having some more trouble now with setting the playback format of the primary sound buffer. Here is my code snippet.
Code:
'_pELog' is of type LPLOGERROR which is my error log class. Anyways, the last if statement in that function is true which isn't good. Am I doing something wrong with setting up the WAVEFORMATEX structure?
___________________________________________
"God is dead." -- Nietsche "Nietsche is dead" -- God |
|
|
|
|
|
#4 |
|
Valued Member
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 155
|
I had a look through my own DSound code, and it seems I never set the format for any sound buffer directly (meaning it gets it from the lpwfxFormat parameter of the DSBUFFERDESC struct that gets passed in on Initialize).
The first thing to try is to determine what error code is being reported (don't just hand the result of the function to the FAILED macro. Assign the method's return value to a variable so you can find out what's gone wrong). One possibility from the the SDK documentation: Since primary sound buffers do not support the IDirectSoundBuffer8 interface, this method must be called on IDirectSoundBuffer. Other than that, do you really need to do this? Another nugget from the docs: When you obtain write access to the primary buffer, other DirectSound features become unavailable. Secondary buffers are not mixed, so hardware-accelerated mixing is unavailable. Most applications should use secondary buffers instead of directly accessing the primary buffer. That's all I can offer at the moment. Good luck! -bignobody |
|
|
|
|
|
#5 |
|
Valued Member
Join Date: Jul 2005
Posts: 117
|
Ah thanks I already solved the problem ages ago.
___________________________________________
"God is dead." -- Nietsche "Nietsche is dead" -- God |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|