您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ FMOD_Channel_Stop函数代码示例

51自学网 2021-06-01 20:42:36
  C++
这篇教程C++ FMOD_Channel_Stop函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中FMOD_Channel_Stop函数的典型用法代码示例。如果您正苦于以下问题:C++ FMOD_Channel_Stop函数的具体用法?C++ FMOD_Channel_Stop怎么用?C++ FMOD_Channel_Stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了FMOD_Channel_Stop函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: FMOD_Channel_Stop

// ----------------------------------------------------------------------------void ofxSoundPlayerFMOD::play(){	// if it's a looping sound, we should try to kill it, no?	// or else people will have orphan channels that are looping	if (bLoop == true){		FMOD_Channel_Stop(channel);	}	// if the sound is not set to multiplay, then stop the current,	// before we start another	if (!bMultiPlay){		FMOD_Channel_Stop(channel);	}	FMOD_System_PlaySound(sys, FMOD_CHANNEL_FREE, sound, bPaused, &channel);	FMOD_Channel_GetFrequency(channel, &internalFreq);	FMOD_Channel_SetVolume(channel,volume);	FMOD_Channel_SetPan(channel,pan);	FMOD_Channel_SetFrequency(channel, internalFreq * speed);	FMOD_Channel_SetMode(channel,  (bLoop == true) ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF);	//fmod update() should be called every frame - according to the docs.	//we have been using fmod without calling it at all which resulted in channels not being able	//to be reused.  we should have some sort of global update function but putting it here	//solves the channel bug	FMOD_System_Update(sys);}
开发者ID:alsdncka,项目名称:digitalstarcode,代码行数:31,


示例2: FMOD_Channel_Stop

bool Systems::SoundSystem::StopSound(const Events::StopSound &event){	auto eComp = m_World->GetComponent<Components::SoundEmitter>(event.Emitter);	if(eComp)	{		FMOD_Channel_Stop(m_Channels[event.Emitter]);	}	else	{		FMOD_Channel_Stop(m_BGMChannel);	}	return true;}
开发者ID:Tleety,项目名称:daydream,代码行数:13,


示例3: WStringToString

	bool ModuleIrisAudio::MePlay(wstring filePath, int volume, int rate){		string sfilepath = WStringToString(filePath);		const char* fpath = sfilepath.c_str();		if (channels == 0){			if (meChannel != NULL){				BOOL isPlaying;				FMOD_Channel_IsPlaying(meChannel, &isPlaying);				if (isPlaying)					FMOD_Channel_Stop(meChannel);			}		}		FMOD_RESULT result;		result = FMOD_System_CreateStream(fmodSystem, fpath, FMOD_DEFAULT, 0, &me);		if (result != FMOD_OK)			return false;		result = FMOD_System_PlaySound(fmodSystem, FMOD_CHANNEL_FREE, me, true, &meChannel);		if (result != FMOD_OK)			return false;		FMOD_Channel_SetMode(meChannel, FMOD_LOOP_NORMAL);		FMOD_Channel_SetVolume(meChannel, volume / 100.0f);		float frequancy;		FMOD_Channel_GetFrequency(meChannel, &frequancy);		FMOD_Channel_SetFrequency(meChannel, frequancy * (rate / 100.0));		FMOD_Channel_SetPaused(meChannel, FALSE);		return true;	}
开发者ID:HADESAngelia,项目名称:Iris-2D-Project,代码行数:34,


示例4: FMOD_Channel_Stop

void Chunk::Stop(){	if( m_pChannel ) {		FMOD_Channel_Stop(m_pChannel);		// m_pChannel->stop();	}}
开发者ID:beebopkim,项目名称:KickItUp,代码行数:7,


示例5: FMOD_Channel_Stop

void Audio::StopAll(){    for (Iterator i = samples.begin(); i != samples.end(); ++i)    {        FMOD_Channel_Stop( (*i)->channel );    }}
开发者ID:narc0tiq,项目名称:Unnamed-Train-Game,代码行数:7,


示例6: CDA_Stop

void CDA_Stop (void){#ifdef UQE_FMOD_CDAUDIO	if(SND_InitialisedCD == false || SND_MusicChannel.inuse == false)		return;	if(SND_MusicChannel.channel)	{		result = FMOD_Channel_Stop(SND_MusicChannel.channel);		FMOD_ERROR(result, true, false);	}	if(fmod_musicCD_subsound)	{		result = FMOD_Sound_Release(fmod_musicCD_subsound);		FMOD_ERROR(result, true, false);	}	if(fmod_musicCD)	{		result = FMOD_Sound_Release(fmod_musicCD);		FMOD_ERROR(result, true, false);	}	SND_MusicChannel.inuse = false;#else	CDAudio_Stop();#endif}
开发者ID:infernuslord,项目名称:uqe-quake,代码行数:31,


示例7: FMOD_Shutdown

void FMOD_Shutdown (void){	if (COM_CheckParm("-nosound"))	{		SND_Initialised = false;		SND_InitialisedCD = false;		return;	}	if (SND_MusicChannel.channel)		FMOD_Channel_Stop(SND_MusicChannel.channel);	CDA_Shutdown();	if (fmod_music)		FMOD_Sound_Release(fmod_music);	if (fmod_system)	{		result = FMOD_System_Close(fmod_system);		FMOD_ERROR(result, true, false);		result = FMOD_System_Release(fmod_system);		FMOD_ERROR(result, true, false);	}	SND_Initialised = false;	SND_InitialisedCD = false;}
开发者ID:infernuslord,项目名称:uqe-quake,代码行数:29,


示例8: stop_sound_num

void stop_sound_num(int num){	if(!sound_is_on)return;		FMOD_Channel_Stop(sound_data[num].voice_num);	sound_data[num].used=0;}
开发者ID:arvidfm,项目名称:fiend,代码行数:7,


示例9: Stop

		//! Stop		void teSound::Stop()		{			if(channel)			{				teSoundManager::CheckResult(FMOD_Channel_Stop(channel));				channel = NULL;			}		}
开发者ID:EvgeniyRudnev,项目名称:tatengine,代码行数:9,


示例10: sound_unload

void sound_unload(void){    if(loaded) {        FMOD_Channel_Stop(_channel);        FMOD_Sound_Release(_sound);        loaded = false;    }}
开发者ID:SailorOnDaTea,项目名称:kissplayer,代码行数:8,


示例11: I_StopSound

void I_StopSound(INT32 handle){	FMOD_CHANNEL *chan;	FMR(FMOD_System_GetChannel(fsys, handle, &chan));	if (music_stream && chan == music_channel)		return;	FMR(FMOD_Channel_Stop(chan));}
开发者ID:HipsterLion,项目名称:SRB2,代码行数:8,


示例12: FindSample

void Audio::Stop(std::string name){    if (!IsPlaying(name)) return;    Sample *sample = FindSample(name);    if (sample == NULL) return;    FMOD_Channel_Stop(sample->channel);}
开发者ID:narc0tiq,项目名称:Unnamed-Train-Game,代码行数:9,


示例13: FMOD_System_Update

void FMCSound::stop(){    m_has_played = false;    FMOD_System_Update(m_fmod_system);    if (m_fmod_channel == 0) return;    FMOD_Channel_Stop(m_fmod_channel);}
开发者ID:Rodeo314,项目名称:vasFMC-Krolock85,代码行数:9,


示例14: StopAudio

void StopAudio() /* Stop the sound if is playing.*/{	if (systemFMOD != NULL)	{		BOOL isPlaying = FALSE;		FMOD_Channel_IsPlaying(channel, &isPlaying);		if (isPlaying)			FMOD_Channel_Stop(channel);	}}
开发者ID:rhpa23,项目名称:IFly_737NG_Gauges,代码行数:10,


示例15: soundHelico

void soundHelico(){	if(helico->positionWin.y + HELICO_HEIGHT < POSITION_BOTTOM-5)	{		if(timeAllowed(&previousTimeSoundHelico, 1300))        	FMOD_System_PlaySound(sound_system, 1, sound_helico, 0, &canal_game);	}	else		FMOD_Channel_Stop(canal_game);}
开发者ID:Ryuuke,项目名称:Choplifter,代码行数:10,


示例16: getChannel

	void AudioPlayer::stopSound( SoundID sID )	{		if ( sID == ERROR_SOUND_ID )			return;		Channel* channel = getChannel( sID );		if ( !channel )			return;		FMOD_CHECK( FMOD_Channel_Stop( channel ) );	}
开发者ID:uvbs,项目名称:GameProject,代码行数:11,


示例17: fmod_stopsound

int fmod_stopsound(){    FMOD_RESULT result;    result = FMOD_Channel_Stop(channel);    //printf("fmod_playsound(%i).../n",i);    if (ERRCHECK(result)) {        printf("error fmod_playsound()/n");        return 1;    }    return 0;}
开发者ID:dstieber,项目名称:parashoot,代码行数:11,


示例18: FMOD_Channel_Stop

void Audio::definirMusique(audio_t m) {	if(_musique == m)		return;		if(_canalMusique) {		FMOD_Channel_Stop(_canalMusique);		_canalMusique = 0;	}		_musique = m;}
开发者ID:rems4e,项目名称:Projet2MIC,代码行数:11,


示例19: FMOD_Channel_Stop

void CSound::Stop(void) {	// Check if we have a sound loaded	if (!mLoaded) {		return;	}#if __ENABLE_CFMOD	// Check if we have a valid channel	if (0 != mpChannel) {		// Stop the channel that is playing the sound		FMOD_Channel_Stop(mpChannel);		mpChannel = 0;	}#endif}
开发者ID:pandaforks,项目名称:Mirage--,代码行数:14,


示例20: FMOD_Channel_Stop

// ---------------------------------------------------------------------------- void ofSoundPlayer::play(){		// if it's a looping sound, we should try to kill it, no?	// or else people will have orphan channels that are looping	if (bLoop == true){		FMOD_Channel_Stop(channel);	}		// if the sound is not set to multiplay, then stop the current,	// before we start another	if (!bMultiPlay){		FMOD_Channel_Stop(channel);	}		FMOD_System_PlaySound(sys, FMOD_CHANNEL_FREE, sound, bPaused, &channel);	FMOD_Channel_GetFrequency(channel, &internalFreq);	FMOD_Channel_SetVolume(channel,volume);	FMOD_Channel_SetPan(channel,pan);	FMOD_Channel_SetFrequency(channel, internalFreq * speed);	FMOD_Channel_SetMode(channel,  (bLoop == true) ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF);		}
开发者ID:LeonFedotov,项目名称:L.A.S.E.R.-TAG-GRL,代码行数:24,


示例21: stop_fiend_music

void stop_fiend_music(void){	if(!sound_is_on)return;	if(strcmp(current_music,"none")==0)return;		if(strcmp(current_music,"none")!=0)	{		FMOD_Channel_Stop(fmod_music_channel);		FMOD_Sound_Release(music_sound);		music_channel = -1;		strcpy(current_music,"none");	}}
开发者ID:arvidfm,项目名称:fiend,代码行数:14,


示例22: while

	void ModuleIrisAudio::FadeBgmThreadProc(int duration){		bgmIsFading = true;		int time = duration;		while (time >= 0){			float v;			FMOD_Channel_SetPaused(bgmChannel, true);			FMOD_Channel_GetVolume(bgmChannel, &v);			FMOD_Channel_SetVolume(bgmChannel, v - v / (duration / 1000));			time -= 1000;			FMOD_Channel_SetPaused(bgmChannel, false);			Sleep(1000);		}		FMOD_Channel_Stop(bgmChannel);		bgmIsFading = false;	}
开发者ID:HADESAngelia,项目名称:Iris-2D-Project,代码行数:15,


示例23: FMOD_Channel_Stop

void Sound::Stop(){	// Check if we have a sound loaded	if (!mLoaded)	{		return;	}	// Check if we have a valid channel	if (0 != mpChannel)	{		// Stop the channel that is playing the sound		FMOD_Channel_Stop(mpChannel);		mpChannel = 0;	}}
开发者ID:NGAEVA,项目名称:2Dgame,代码行数:16,


示例24: stop_all_sounds

void stop_all_sounds(void){	int i;	if(!sound_is_on)return;		for(i=0;i<MAX_SOUNDS_PLAYING;i++)	{		if(sound_data[i].used)		{			FMOD_Channel_Stop(sound_data[i].voice_num);			sound_data[i].used=0;		}	}}
开发者ID:arvidfm,项目名称:fiend,代码行数:16,


示例25: FMOD_System_Create

bool ClientActionToneMelody::runAction(){    FMOD_RESULT result;    if (!system) {        channel = 0;        result = FMOD_System_Create(&system);        ERRCHECK(result);        FMOD_System_SetDSPBufferSize(system, 64, 1);        result = FMOD_System_Init(system, 2, FMOD_INIT_STREAM_FROM_UPDATE | FMOD_INIT_MIX_FROM_UPDATE, NULL);        ERRCHECK(result);        result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_OSCILLATOR, &dsp);        ERRCHECK(result);    }    if (channel) {        result = FMOD_Channel_Stop(channel);        ERRCHECK(result);        channel = 0;    }    if (tone_frequency) {        result = FMOD_DSP_SetParameterFloat(dsp, FMOD_DSP_OSCILLATOR_RATE, (float) tone_frequency);        ERRCHECK(result);        result = FMOD_System_PlayDSP(system, dsp, 0, true, &channel);        ERRCHECK(result);        result = FMOD_Channel_SetVolume(channel, 1.0f);        ERRCHECK(result);        result = FMOD_DSP_SetParameterInt(dsp,FMOD_DSP_OSCILLATOR_TYPE, 1);        ERRCHECK(result);        StartMelodyTone(settings->value("MELODY"));        updateTimer->start();        settings->insert("ACTIVE", "1");    } else {        updateTimer->stop();        periodicToneTimer->stop();        prog_led_tone_control = false;        tone_state = false;        tone_periodic = false;        tone_period = 0;        settings->insert("ACTIVE", "0");    }    return true;}
开发者ID:Pvg08,项目名称:CStationClient_DS_PC,代码行数:47,


示例26: play_fiend_music

int play_fiend_music(char* file, int loop){	char path[100];	char error_string[50];		if(!sound_is_on)return -1;		if(strcmp(file,current_music)==0)return 1;		if(strcmp(current_music,"none")!=0)	{		FMOD_Channel_Stop(fmod_music_channel);		FMOD_Sound_Release(music_sound);	}		sprintf(path,"music/%s",file);		if(loop)	{				FMOD_System_CreateSound(fmod_system, path, FMOD_SOFTWARE | FMOD_CREATESTREAM, &soundex_info, &music_sound);		music_is_looping = 1;	}	else	{		FMOD_System_CreateSound(fmod_system, path, FMOD_SOFTWARE | FMOD_CREATESTREAM, &soundex_info, &music_sound);		music_is_looping=0;	}		if(music_sound==NULL)	{		sprintf(error_string,"Error loading stream /"%s/" ",path);		make_engine_error(error_string);		return 0;	}		strcpy(current_music,file);		speed_counter=0;	FMOD_System_PlaySound(fmod_system, FMOD_CHANNEL_FREE, music_sound, 0, &fmod_music_channel);		set_fiend_music_volume(fiend_music_volume);		return 1;}
开发者ID:arvidfm,项目名称:fiend,代码行数:46,



注:本文中的FMOD_Channel_Stop函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ FMOD_ErrorString函数代码示例
C++ FMOD_Channel_SetPaused函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。