Ejemplo n.º 1
0
bool BrainSoundFMODEX::checkResult(const FMOD_RESULT& result) const
{
	if (result != FMOD_OK)
	{
		printf("ERROR/FMOD - (%d) %s\n", result, FMOD_ErrorString(result));
		return false;
	}
	return true;
}
Ejemplo n.º 2
0
void checkFmodResult(FMOD_RESULT result)
{
	if(result != FMOD_OK)
	{
		std::string message(FMOD_ErrorString(result));
		GameEngine::getSingleton().getLog()->logMessage("FMOD error: " + message, Ogre::LML_CRITICAL);
		throw std::runtime_error("FMOD error:" + message);
	}
}
Ejemplo n.º 3
0
//sets the actual playing sound's volume
void Sound::setVolume (float v) {
    if (possible && on && v >= 0.0f && v <= 1.0f) {
      FMOD_RESULT vol = FMOD_Channel_SetVolume(channel, v);
      printf("%s\n", FMOD_ErrorString(vol));
      if(channel) {
        printf("A channel is present\n");
      }
    }
}
Ejemplo n.º 4
0
void ERRCHECK_bank(FMOD_RESULT result, const char *file, int line)
{
#ifdef _DEBUG
    if (result != FMOD_OK)
    {
        BaseSubsystems::Log::Error(FMOD_ErrorString(result));
    }
#endif
}
Ejemplo n.º 5
0
void SoundSystem::FSOUND_SetMute(int channel, signed char mute)
{
	signed char r = ::FSOUND_SetMute(channel, mute);

#ifndef NDEBUG
	if(r == FALSE)
	{
		if(mute)
		{
			FAIL("Failed to mute channel " + itos(channel) + ": " + FMOD_ErrorString(FSOUND_GetError()));
		}
		else
		{
			FAIL("Failed to unmute channel " + itos(channel) + ": " + FMOD_ErrorString(FSOUND_GetError()));
		}
	}
#endif
}
Ejemplo n.º 6
0
	static void ERRCHECK(FMOD_RESULT result)
	{
		if (result != FMOD_OK)
		{
			assert( 0 );
			printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
			::exit(-1);
		}
	}
Ejemplo n.º 7
0
	void FmodErrorCheck(FMOD_RESULT result)        // this is an error handling function
	{                                              // for FMOD errors
		if (result != FMOD_OK)
		{
			printf("FMOD error! (%d) %s", result, FMOD_ErrorString(result));
			std::system("Pause");
			exit(-1);
		}
	}
Ejemplo n.º 8
0
bool ERRCHECK(FMOD_RESULT result)
{
    if (result != FMOD_OK)
    {
        printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
        return true;
    }
    return false;
}
Ejemplo n.º 9
0
int Music::initSound(void) {
	
	this->scaler=12;
	this->accumSeconds=0;
	
	FMOD_RESULT result;
	
	result = FMOD::System_Create(&system);
	if(result != FMOD_OK)
	{
		printf("Music: Patada! (%d) %s\n", result, FMOD_ErrorString(result));
		return -1;
	}
	else
	{	
		result = system->setOutput(FMOD_OUTPUTTYPE_ALSA);
		result = system->setDSPBufferSize(512, 4);
		result = system->init(100, FMOD_INIT_NORMAL, 0);
		// FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), true);  // TODO
	
		if(result != FMOD_OK)
		{
			printf("Music: Ay! %s\n", FMOD_ErrorString(result));
			
			int numDrivers;
			system->getNumDrivers(&numDrivers);
			printf("There are %d available drivers\n", numDrivers);
			for(int i = 0; i < numDrivers; i++)
			{
				char driverName[255];
				system->getDriverInfo(i, driverName, 255, 0);
				printf("%d %s\n", i, driverName);
			}
			
			
			exit(-1);
		}
		else
		{
			this->musicStarted=0;
			return(0);
		}
	}
}
Ejemplo n.º 10
0
//For errorchecking the results of FMOD functions
void SoundManager::FMODErrorCheck(FMOD_RESULT result)
{
	if (result != FMOD_OK)
	{
		//Makes an stringstream with error message and send to messagebox function
		std::stringstream _ss;
		_ss << "FMOD error! (" << result << ") " << FMOD_ErrorString(result) << "\nGame Shutting Down";
		MessageBoxAndShutDown(&_ss);
	}
}
void LLAudioBufferFMOD::set3DMode(bool use3d)
{
	U16 current_mode = FSOUND_Sample_GetMode(mSamplep);
	
	if (use3d)
	{
		if (!FSOUND_Sample_SetMode(mSamplep, (current_mode & (~FSOUND_2D))))
		{
			llwarns << "LLAudioBufferFMOD::set3DMode error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
		}
	}
	else
	{
		if (!FSOUND_Sample_SetMode(mSamplep, current_mode | FSOUND_2D))
		{
			llwarns << "LLAudioBufferFMOD::set3DMode error: " << FMOD_ErrorString(FSOUND_GetError()) << llendl;
		}
	}
}
Ejemplo n.º 12
0
	void AudioClip::ErrorCheck(FMOD_RESULT result)
	{
		if (result != FMOD_OK)
		{
			string errorString = "FMOD Error! ";
			errorString.append(std::to_string(result));
			errorString.append(" ").append(FMOD_ErrorString(result));
			debugging::Debug::LogError(nullptr, errorString.c_str());
		}
	}
Ejemplo n.º 13
0
bool
CFModExDriver::ERRCHECK(const FMOD_RESULT& result)
{
    if (result != FMOD_OK)
    {
        _LOG_ERROR << "FMOD error! " <<  result << FMOD_ErrorString(result);
        return true;
    }
    return false;
}
Ejemplo n.º 14
0
void FMOD_ERRCHECK(FMOD_RESULT result)
{
	if (result != FMOD_OK)
	{
		printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
#if defined(INTERACTIVE)
		system("pause");
#endif
		exit(-1);
	}
}
Ejemplo n.º 15
0
	// Play the sound once
	void Sound2D::Play()
	{
		FMOD_RESULT result;

		result = mSystem->playSound(FMOD_CHANNEL_FREE, mSound, false, NULL);
		if (result != FMOD_OK)
		{
			printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
			exit(-1);
		}
	}
Ejemplo n.º 16
0
void SoundManager::ERRCHECK(FMOD_RESULT result)
{
#ifdef _DEBUG

	if (result != FMOD_OK)
	{
		std::cout << "FMOD error! (" << result << ") " << FMOD_ErrorString(result) << std::endl;
	}

#endif
}
Ejemplo n.º 17
0
void ERRCHECK(FMOD_RESULT result)
{
    if (result != FMOD_OK)
    {
        if (Common_Private_Error)
        {
            Common_Private_Error(result);
        }
        Common_Fatal("FMOD error %d - %s", result, FMOD_ErrorString(result));
    }
}
Ejemplo n.º 18
0
 Exception::Exception( const string& description, const string& source, FMOD_RESULT result, const Type type ):
 mDescription( description ), mSource( source ), mType( type )
 {
   if ( mType == Type::FMOD )
   {
     FMODError error;
     error.code = result;
     error.description = FMOD_ErrorString( result );
     mAdditional = error;
   }
 }
Ejemplo n.º 19
0
//loads a soundfile
void Sound::load (const char * filename) {
    currentSound = (char *)filename;
    if (possible && on) {
        result = FMOD_Sound_Release(sound);
        result = FMOD_System_CreateStream(fmodsystem, currentSound, FMOD_LOOP_NORMAL, 0, &sound);
        if (result != FMOD_OK) {
          possible = false;
          printf("%s: %s\n", FMOD_ErrorString(result), filename);
        }
    }
}
Ejemplo n.º 20
0
bool ERRCHECK(FMOD_RESULT result)
{
	if (result != FMOD_OK)
	{
		std::ostringstream os;
		os << "FMOD error! ( "<< result << ") " << FMOD_ErrorString(result);
		toErrorLog(os.str());
		return false;
	}
	return true;
}
Ejemplo n.º 21
0
void SoundSystem::FSOUND_StopSound(int channel)
{
	signed char r = ::FSOUND_StopSound(channel);

#ifndef NDEBUG
	if(r == FALSE)
	{
		FAIL(string("Failed to stop all sounds: ") +
			FMOD_ErrorString(FSOUND_GetError()));
	}
#endif
}
Ejemplo n.º 22
0
//
// load audio file
//
bool Audio::loadFile() {
    printf("%s\n", files[curFile].c_str());
    result = sys->createSound( files[curFile].c_str(), FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESTREAM, 0, &sound);

    if (result != FMOD_OK) {
        printf("Error loading %s\n", files[curFile].c_str());
        printf("(%d) %s\n", result, FMOD_ErrorString(result));
        return false;
    }
    sound->getLength(&length, FMOD_TIMEUNIT_PCM);
    return true;
}
Ejemplo n.º 23
0
void SoundSystem::FSOUND_SetSFXMasterVolume(int volume)
{
	::FSOUND_SetSFXMasterVolume(volume);

#ifndef NDEBUG
	int fmod_err = FMOD_ERR_NONE;
	if((fmod_err = FSOUND_GetError()) != FMOD_ERR_NONE)
	{
		FAIL("Failed to set master sfx volume: " + itos(volume) + ": " + FMOD_ErrorString(fmod_err));
	}
#endif
}
Ejemplo n.º 24
0
void gep::FmodSound::load(const FMOD::Studio::ID& id)
{
    FmodSoundSystem* pSystem = static_cast<FmodSoundSystem*>(g_globalManager.getSoundSystem());
    auto result = pSystem->getFmodHandle().getEvent(&id, FMOD_STUDIO_LOAD_BEGIN_NOW, &m_eventDescription);
    if(result != FMOD_OK)
    {
        std::ostringstream msg;
        msg << "Error loading event: " << FMOD_ErrorString(result);
        throw LoadingError(msg.str());
    }
    m_bLoaded = true;
}
Ejemplo n.º 25
0
	Sound2D::Sound2D(const std::string& path, FMOD::System* soundSystem)
		: mSystem(soundSystem)
	{
		FMOD_RESULT result;

		// FMOD_DEFAULT uses the defaults. These are the same as FMOD_LOOP_OFF | FMOD_2D | FMOD_HARDWARE.
		result = soundSystem->createSound(path.c_str(), FMOD_DEFAULT, 0, &mSound);
		if (result != FMOD_OK)
		{
			printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
		}
	}
Ejemplo n.º 26
0
//returns true if there is an error
bool Player::ErrorCheck(FMOD_RESULT result)
{
	if (result != FMOD_OK)
	{
		std::cerr << "FMOD error! (" << result << ") "
			<< FMOD_ErrorString(result) << std::endl;

		return true;
	}
	else
		return false;
}
Ejemplo n.º 27
0
int		sound_init(Sound* s)
{
    FMOD_RESULT	res;

    if (   FMOD_OK != (res = FMOD_System_Create(&s->system))
            || FMOD_OK != (res = FMOD_System_Init(s->system, 32, FMOD_INIT_NORMAL, NULL))
            || FMOD_OK != (res = FMOD_System_CreateSound(s->system, "sound/xship_shoot.wav", FMOD_SOFTWARE, 0, &s->mp3[SND_XHSIP_SHOOT]))
            || FMOD_OK != (res = FMOD_System_CreateSound(s->system, "sound/menu_open.wav", FMOD_SOFTWARE, 0, &s->mp3[SND_MENU_OPEN]))
       )
        return printf("FMOD error! (%d) %s\n", res, FMOD_ErrorString(res));
    return 0;
}
Ejemplo n.º 28
0
FMOD::Channel *Game::playSound(FMOD::Sound *sound)
{
	FMOD::Channel *channel;
	FMOD_RESULT result = fmod->playSound(FMOD_CHANNEL_FREE, sound, false, 0);

	if (result != FMOD_OK)
	{
		printf("FMOD error (%d): %s\n", result, FMOD_ErrorString(result));
		return nullptr;
	}

	return channel;
}
Ejemplo n.º 29
0
// Initialization of Audio
bool HamurAudioManager::Init(int mixrate, int maxsoftwarechannels, unsigned int flags)
{
	if(!FSOUND_Init(mixrate, maxsoftwarechannels, flags))
	{
		HAMURLOG->WriteLogln(FMOD_ErrorString(FSOUND_GetError()));
		return false;
	}
	else
	{
		HAMURLOG->WriteInitLog("HamurAudioManager");
		return true;
	}
}
Ejemplo n.º 30
0
void UAudioCaptureMic::mainLoopEnd()
{
    UDEBUG("");
    FMOD_RESULT result;
    FMOD_BOOL isRecording;
    result = UAudioSystem::isRecording(_driver, &isRecording); UASSERT_MSG(result==FMOD_OK, FMOD_ErrorString(result));

    if(isRecording)
    {
        result = UAudioSystem::recordStop(_driver); UASSERT_MSG(result==FMOD_OK, FMOD_ErrorString(result));
    }
    UAudioCapture::mainLoopEnd();
}