Jump to content

  • Log In with Google      Sign In   
  • Create Account


XACT3 SoundBank initialisation problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Tank202   Members   -  Reputation: 171

Like
0Likes
Like

Posted 21 March 2013 - 03:29 PM

Hello,

 

I have this very strange problem with XACT3. I'm trying to play a sound using SoundBank interface, but it seems that SoundBank object pointer after initialisation is NULL. When I run the program, it would not respond.

 

PS. Using WaveBank interface, the program runs just fine.

 

Please help me with this issue. I would be glad as hell biggrin.png

 

Here is the code:

 

	//XACT3 stuff
	CoInitializeEx(NULL, COINITBASE_MULTITHREADED);

	IXACT3Engine* pXACT3Engine;
	XACT3CreateEngine(0, &pXACT3Engine);

	XACT_RUNTIME_PARAMETERS XACT3Parameters = {0};
	
	XACT3Parameters.lookAheadTime = XACT_ENGINE_LOOKAHEAD_DEFAULT;

	pXACT3Engine->Initialize(&XACT3Parameters);

	IXACT3SoundBank* pSoundBank;

	HANDLE hMusicWaveBank = CreateFile("Music.xwb", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
	HANDLE hMusicSoundBank = CreateFile("MusicList.xsb", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);

	pXACT3Engine->CreateInMemoryWaveBank(MapViewOfFile(CreateFileMapping(hMusicWaveBank, 0, PAGE_READONLY, NULL, 
		GetFileSize(hMusicWaveBank, NULL), 0), FILE_MAP_READ, 0, 0, 0), GetFileSize(hMusicWaveBank, NULL), 0, 0, &pWaveBank);

	BYTE* pbMusicSoundBankBuffer = new BYTE[GetFileSize(hMusicSoundBank, NULL)];
	pXACT3Engine->CreateSoundBank(pbMusicSoundBankBuffer, GetFileSize(hMusicSoundBank, NULL), 0, 0, &pSoundBank); //I've tried a lot of ways to get the first argument but nothing worked.

	IXACT3Cue* pCue;

	pSoundBank->Play(0, 0, 0, 0); //<- The point where the program stops responding

	//Win32 message loop
	while(GetMessage(&msg, hMainWindow, 0, 0) > 0)
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
		pXACT3Engine->DoWork();
		//Sleep(10);
	}

	pXACT3Engine->ShutDown();

 

 



Sponsor:

#2 ankhd   Members   -  Reputation: 1072

Like
0Likes
Like

Posted 22 March 2013 - 01:27 AM

Hi. first try some debug flags

DWORD dwCreationFlags = 0;

 

if( bAuditionMode )

dwCreationFlags |= XACT_FLAG_API_AUDITION_MODE;

 

if( bDebugMode )

dwCreationFlags |= XACT_FLAG_API_DEBUG_MODE;

 

Pass this to XACT3CreateEngine.

 

cheack your return code here pXACT3Engine->Initialize(&XACT3Parameters);



#3 Tank202   Members   -  Reputation: 171

Like
0Likes
Like

Posted 22 March 2013 - 05:21 AM

Ok I've tried everything you suggested but nothing seems to help. However when I switch the creation flag to AUDITION_MODE it seems to initialise the SoundBank, but the program still won't play sounds using soundBank interface. Both of the cases the return value of  pXACT3Engine->Initialize(&XACT3Parameters); was S_OK. 

Maybe it is the library problem as pXACT3Engine->CreateSoundBank function is declared in xact3.lib and I dont have it in my directX SDK library folders. And also when installing my directX SDK at the end I get the error that says something like S 1024 or 1028 tongue.png


Edited by Tank202, 22 March 2013 - 05:23 AM.


#4 ankhd   Members   -  Reputation: 1072

Like
0Likes
Like

Posted 22 March 2013 - 06:11 PM

There should be debug errors.
Set your app to debug




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS