void ofxOpenALSoundPlayer::initializeSoundEngine() {
	if(!SoundEngineInitialized){
		
		OSStatus err = SoundEngine_Initialize(44100);
				
		if(err)
			cerr<<"ERROR failed to initialize soundEngine."<<endl;
		else {
			numSounds=1;
			mp3Loaded=false;
			
			SoundEngineInitialized = true;
			OSStatus err = SoundEngine_SetListenerPosition(0.0f, 0.0f, 0.0f);
			if(err)
				cerr<<"ERROR failed to set listener position in init..\n (if you are running in the simulator, this is normal, sounds won't work.)"<<endl;
		}
	}
}
Example #2
0
RudeSound::RudeSound()
{
	m_soundon = true;
	m_musicOn = true;
	
	m_curBGM = kBGMNone;
	
	m_bgmVolFadeEnabled = false;
	m_bgmVol = 1.0;
	m_bgmVolFade = 0.0;

#if defined(RUDE_IPHONE) || defined(RUDE_MACOS)
	SoundEngine_Initialize(44100);
	SoundEngine_SetListenerPosition(0.0, 0.0, kListenerDistance);
#endif

	for(int i = 0; i < kNumSounds; i++)
	{
		m_soundids[i] = -1;

		LoadWave(kSoundFilenames[i], (eSoundEffect) i);
	}
	
	RudeRegistry *reg = RudeRegistry::GetSingleton();
	
	int loadsize = sizeof(m_musicOn);
	if(reg->QueryByte("GOLF", "RS_MUSIC", &m_musicOn, &loadsize) == 0)
	{
		
	}
	else
	{
		m_musicOn = true;
	}
	
}