🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

pass the segment to a function to load a sound

Started by
0 comments, last by da_cobra 22 years, 6 months ago
how can I pass a IDirectMusicSegment8 to a function that loads a wave file I already tried a lot of things but it still doesn''t work?!? here''s my LoadSound function
  
void LoadSound(WCHAR wstrFileName[20]) 
	{
	if (FAILED(G.g_pLoader->LoadObjectFromFile(
        CLSID_DirectMusicSegment,		// Class identifier.

        IID_IDirectMusicSegment8,		// ID of desired interface.

        wstrFileName,				    // Filename.

		(LPVOID*) &G.g_pSegment)))      // Pointer that receives interface.

       	{
        MessageBox( NULL, "Media not found, ", 
                          "DMusic Tutorial", MB_OK );
        }
	G.g_pSegment->Download(G.g_pPerformance) ;
	} // end of LoadSound

  
I already tried : void LoadSound(WCHAR wstrFileName[20], IDirectMusicSegment8 Segment) like I did in my LoadBitmap function : int LoadBitmap(int xDest, int yDest, char *File, LPDIRECTDRAWSURFACE7 surface) but this doesn''t work can anyone help me pls thanx in advance
Advertisement
You have to pass the OFFSET to the function, not the SEGMENT. In a WAVE-file, everything is organized in 64k blocks.

Kneelz

This topic is closed to new replies.

Advertisement