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.
Direct Audio 8?
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
If you use . or .., the path is relative to the ''working directory'' under the project settings.
So you can set the default dir there.
So you can set the default dir there.
./ is current working path (ussually the directory of the exe, or where it was run from)
../ is parent of current working path
../ 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
- LongingForDeath
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement