Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ACAC

Direct Audio 8?

This topic is 6007 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok ive been playing with direct audio, I managed to get the tutorials sound to load ( the SDK one ) but I couldnt get my own to. I figured it was the part that sets the directory to look at but I couldnt figure out that anyways heres the code
WCHAR current[MAX_PATH] = L".";
 
    // Set the search directory.
 
    Loader->SetSearchDirectory(
        GUID_DirectMusicAllTypes, // Types of files sought.
        current,             // Where to look.
        FALSE             // Don''t clear object data.
    );

	WCHAR wstrFileName[MAX_PATH] = L"sacrgame.wav";

    if (FAILED(Loader->LoadObjectFromFile(
        CLSID_DirectMusicSegment,   // Class identifier.
        IID_IDirectMusicSegment8,   // ID of desired interface.
        wstrFileName,               // Filename.
        (LPVOID*) &Segment       // Pointer that receives interface.
    )))
    {
        MessageBox( NULL, "Media not found, sample will now quit.", 
                          "DMusic Tutorial", MB_OK );
        return 0;
    }
 
Now if its messed, tell me :-) Im not sure how to set to look in the current directory, could anyone help? or maybe a file sound directory, thanks see ya.

Share this post


Link to post
Share on other sites
Advertisement
./ is current working path (ussually the directory of the exe, or where it was run from)
../ is parent of current working path

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!