XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Problems using DirectSound

Last post 11/27/2008 7:14 PM by andreibanc. 2 replies.
  • 11/26/2008 3:30 PM

    Problems using DirectSound

    Hi! I'm using Visual C++ 2005 Express Edition and I am trying to create an application that uses DirectSound. I found on DirectSound Documentation how to initiate it, but I still have some problems.

    When I initiate last member of DSBUFFERDESC (the struct that describes the characteristics of a new buffer), i get this error:
     
    1>main.obj : error LNK2019: unresolved external symbol _GUID_NULL referenced in function "void __cdecl InitDirectSound(struct HWND__ *)" (?InitDirectSound@@YAXPAUHWND__@@@Z)

    Here is the code, where "GUID_NULL" (which is defined in dsound.h) appears:

    DSBUFFERDESC pcDSPrimaryBufferDesc;

    pcDSPrimaryBufferDesc.guid3DAlgorithm=GUID_NULL;

     
    On my project Propetries>>Configuration Propetries>>Linker>>Input>>ADDITIONAL DEPENDENCIES I added dsound.lib (and also dxguid.lib), but on DirectX Documentation it says that some DirectSound functions use Dsound3d.dll as import library.

    Where should I add it? what did I missed? Thank you in advance!
  • 11/26/2008 7:27 PM In reply to

    Re: Problems using DirectSound

    #include <guiddef.h> 
     

    That shoudl take care of it. If it doesn't, then you can just set it with memset(, 0,) or ZeroMemory() instead.

    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 11/27/2008 7:14 PM In reply to

    Re: Problems using DirectSound

    I finally managed to resolve that linking error (adding some extra .lib-s on Additional Dependencies), but now I get another one.
    When I am using 
    mmioOpen() function in order to import a wav file, although I've added "Winmm.lib" (and some more, as I've seen in a project called "PlaySound" from Microsoft DirectX SDK), I get this:

     

    1>main.obj : error LNK2019: unresolved external symbol __imp__mmioOpenA@12 referenced in function "void __cdecl InitDirectSound(struct HWND__ *)" (?InitDirectSound@@YAXPAUHWND__@@@Z)


    Here is the code:



    HMMIO hWav;

    hWav =mmioOpen(

    "test.wav", NULL, MMIO_READ | MMIO_ALLOCBUF);

     


    Moreover, if I somehow resolve this error, is it really the best way to import a wave file by using mmioOpen() and its "company" or not...? ... Or should I use OpenAL instead of DirectX? (I need MINIMUM delay of sound...)

    Thanks a lot!

Page 1 of 1 (3 items) Previous Next