Archived

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

ACAC

Direct Audio 8?

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