Archived

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

Direct Audio 8?

Recommended Posts

ACAC    122
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.

GUID_DirectMusicAllTypes, // Types of files sought.
current,             // Where to look.
FALSE             // Don''t clear object data.
);

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

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 on other sites
Shannon Barber    1681
If you use . or .., the path is relative to the ''working directory'' under the project settings.

So you can set the default dir there.

Share on other sites
a person    118
./ is current working path (ussually the directory of the exe, or where it was run from)
../ is parent of current working path