Direct Audio 8?

Started by
2 comments, last by ACAC 22 years, 2 months ago
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.
Advertisement
If you use . or .., the path is relative to the ''working directory'' under the project settings.

So you can set the default dir there.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
./ is current working path (ussually the directory of the exe, or where it was run from)
../ is parent of current working path
I think if you want to use the current path, then you don''t have to set a search directory. The current path should be set as default.


- LongingForDeath
visit DyingHour

This topic is closed to new replies.

Advertisement