Jump to content
  • Advertisement


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


pass the segment to a function to load a sound

This topic is 6102 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
You have to pass the OFFSET to the function, not the SEGMENT. In a WAVE-file, everything is organized in 64k blocks.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!