本文整理汇总了C++中FMOD_Channel_Stop函数的典型用法代码示例。如果您正苦于以下问题:C++ FMOD_Channel_Stop函数的具体用法?C++ FMOD_Channel_Stop怎么用?C++ FMOD_Channel_Stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FMOD_Channel_Stop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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;
}
示例4: FMOD_Channel_Stop
void Chunk::Stop()
{
if( m_pChannel ) {
FMOD_Channel_Stop(m_pChannel);
// m_pChannel->stop();
}
}
示例5: FMOD_Channel_Stop
void Audio::StopAll()
{
for (Iterator i = samples.begin(); i != samples.end(); ++i)
{
FMOD_Channel_Stop( (*i)->channel );
}
}
示例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
}
示例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;
}
示例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;
}
示例9: Stop
//! Stop
void teSound::Stop()
{
if(channel)
{
teSoundManager::CheckResult(FMOD_Channel_Stop(channel));
channel = NULL;
}
}
示例10: sound_unload
void sound_unload(void)
{
if(loaded) {
FMOD_Channel_Stop(_channel);
FMOD_Sound_Release(_sound);
loaded = false;
}
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}