这篇教程C++ FMOD_Channel_SetPaused函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中FMOD_Channel_SetPaused函数的典型用法代码示例。如果您正苦于以下问题:C++ FMOD_Channel_SetPaused函数的具体用法?C++ FMOD_Channel_SetPaused怎么用?C++ FMOD_Channel_SetPaused使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了FMOD_Channel_SetPaused函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: FMOD_Channel_GetPausedvoid SoundEngine::togglePauseChannel(unsigned int channel){ FMOD_BOOL etat; FMOD_CHANNEL *canal=getChannel(channel); FMOD_Channel_GetPaused(canal, &etat); if (etat == 1) // Si la chanson est en pause FMOD_Channel_SetPaused(canal, 0); // On enlève la pause else // Sinon, elle est en cours de lecture FMOD_Channel_SetPaused(canal, 1); // On met en pause}
开发者ID:bsignoret,项目名称:Bomberman-like-reseau,代码行数:11,
示例2: 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,
示例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: FindSamplebool Audio::Play(std::string name){ FMOD_RESULT res; Sample *sample = FindSample(name);//***BUG if (!sample) return false; if (sample->sample != NULL) { try { //sample found, play it res = FMOD_System_PlaySound( system, FMOD_CHANNEL_FREE, sample->sample, true, &sample->channel); if (res!= FMOD_OK) return false; FMOD_Channel_SetLoopCount(sample->channel, -1); FMOD_Channel_SetPaused(sample->channel, false); } catch (...) { return false; } } return true;}
开发者ID:narc0tiq,项目名称:Unnamed-Train-Game,代码行数:29,
示例5: FMOD_Channel_SetPaused// ----------------------------------------------------------------------------void ofxSoundPlayerFMOD::setPaused(bool bP){ if (getIsPlaying() == true){ FMOD_Channel_SetPaused(channel,bP); bPaused = bP; }}
开发者ID:alsdncka,项目名称:digitalstarcode,代码行数:8,
示例6: FMOD_Channel_GetPaused// toggles pause/unpausevoid Sound::togglePause(void){ FMOD_BOOL p; FMOD_Channel_GetPaused(channel, &p); FMOD_Channel_SetPaused(channel, !p);}
开发者ID:jonquach,项目名称:bomberman,代码行数:8,
示例7: FMOD_System_PlaySoundbool Audio::Play(Sample *sample){ FMOD_RESULT res; if (sample == NULL) return false; if (sample->sample == NULL) return false; try { res = FMOD_System_PlaySound( system, FMOD_CHANNEL_FREE, sample->sample, true, &sample->channel); if (res!= FMOD_OK) return false; FMOD_Channel_SetLoopCount(sample->channel, -1); FMOD_Channel_SetPaused(sample->channel, false); } catch (...) { return false; } return true;}
开发者ID:narc0tiq,项目名称:Unnamed-Train-Game,代码行数:25,
示例8: I_StartSoundINT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority){ FMOD_SOUND *sound; FMOD_CHANNEL *chan; INT32 i; float frequency; sound = (FMOD_SOUND *)S_sfx[id].data; I_Assert(sound != NULL); FMR(FMOD_System_PlaySound(fsys, FMOD_CHANNEL_FREE, sound, true, &chan)); if (sep == 0) sep = 1; FMR(FMOD_Channel_SetVolume(chan, (vol / 255.0) * (sfx_volume / 31.0))); FMR(FMOD_Channel_SetPan(chan, (sep - 128) / 127.0)); FMR(FMOD_Sound_GetDefaults(sound, &frequency, NULL, NULL, NULL)); FMR(FMOD_Channel_SetFrequency(chan, (pitch / 128.0) * frequency)); FMR(FMOD_Channel_SetPriority(chan, priority)); //UNREFERENCED_PARAMETER(priority); //FMR(FMOD_Channel_SetPriority(chan, 1 + ((0xff-vol)>>1))); // automatic priority 1 - 128 based on volume (priority 0 is music) FMR(FMOD_Channel_GetIndex(chan, &i)); FMR(FMOD_Channel_SetPaused(chan, false)); return i;}
开发者ID:HipsterLion,项目名称:SRB2,代码行数:29,
示例9: whitgl_sound_playvoid whitgl_sound_play(int id, float adjust){ int index = -1; int i; for(i=0; i<num_sounds; i++) { if(sounds[i].id == id) { index = i; continue; } } if(index == -1) { WHITGL_LOG("ERR Cannot find sound %d", id); return; } FMOD_RESULT result = FMOD_System_PlaySound(fmodSystem, FMOD_CHANNEL_FREE, sounds[index].sound, true, &sounds[index].channel); _whitgl_sound_errcheck("FMOD_System_PlaySound", result); float defaultFrequency; result = FMOD_Sound_GetDefaults(sounds[index].sound, &defaultFrequency, NULL, NULL, NULL); _whitgl_sound_errcheck("FMOD_Sound_GetDefaults", result); result = FMOD_Channel_SetFrequency(sounds[index].channel, defaultFrequency*adjust); _whitgl_sound_errcheck("FMOD_Channel_SetFrequency", result); result = FMOD_Channel_SetPaused(sounds[index].channel, false); _whitgl_sound_errcheck("FMOD_Channel_SetPaused", result);}
开发者ID:whitingjp,项目名称:ld29,代码行数:29,
示例10: sound_toggle_pausevoid sound_toggle_pause(void){ if (loaded) { FMOD_BOOL p; FMOD_Channel_GetPaused(_channel,&p); FMOD_Channel_SetPaused (_channel,!p); }}
开发者ID:SailorOnDaTea,项目名称:kissplayer,代码行数:8,
示例11: exceptionvoid AudioManager::Play( const AudioManager::AudioType Type, const string& ID, const float Volume, const float Pitch, const float Pan, const int32_t LoopCount, const int32_t Priority, const FMOD_CHANNELINDEX ChannelIndex ){ // Create local variables. float Frequency = Null; FMOD_CHANNEL* Channel = nullptr; unordered_map< string, SoundData >::iterator AudioMapIterator; // Check arguments. if( Type == MaxAudioTypes ) throw exception(); // Playback specified audio sample or stream. if( Initialized ) { AudioMapIterator = AudioMaps[ Type ].Instance.find( ID ); if( AudioMapIterator == AudioMaps[ Type ].Instance.end() ) throw exception(); if( FMOD_System_PlaySound( SystemInstance, ChannelIndex, AudioMapIterator->second.Instance, true, &Channel ) != FMOD_OK ) throw exception(); if( FMOD_Channel_SetChannelGroup( Channel, AudioMapIterator->second.Group ) != FMOD_OK ) throw exception(); if( FMOD_Channel_SetLoopCount( Channel, LoopCount ) != FMOD_OK ) throw exception(); if( FMOD_Channel_SetPriority( Channel, Priority ) != FMOD_OK ) throw exception(); if( FMOD_Channel_SetPan( Channel, Pan ) != FMOD_OK ) throw exception(); if( FMOD_Channel_GetFrequency( Channel, &Frequency ) != FMOD_OK ) throw exception(); if( FMOD_Channel_SetFrequency( Channel, ( Frequency * Pitch ) ) != FMOD_OK ) throw exception(); if( FMOD_Channel_SetVolume( Channel, Volume ) != FMOD_OK ) throw exception(); if( FMOD_Channel_SetPaused( Channel, false ) != FMOD_OK ) throw exception(); }}
开发者ID:awillett,项目名称:Team8,代码行数:57,
示例12: FMOD_Channel_GetPausedvoid Audio::pauseMusique() { if(!_canalMusique) return; FMOD_BOOL pause; FMOD_Channel_GetPaused(_canalMusique, &pause); FMOD_Channel_SetPaused(_canalMusique, !pause);}
开发者ID:rems4e,项目名称:Projet2MIC,代码行数:9,
示例13: FMOD_Sound_Releasevoid Sound::load() { if (loaded) { FMOD_Sound_Release(audio); } char *path = &location[0u]; FMOD_System_CreateSound(system, path, FMOD_SOFTWARE, 0, &audio); FMOD_Channel_SetChannelGroup(channel, channelGroup); FMOD_Channel_SetPaused(channel, true); loaded = true;}
开发者ID:andreisergiu98,项目名称:squarly-hoop,代码行数:10,
示例14: set_pausedvoid set_paused(FMOD_CHANNEL **channel, int paused){ FMOD_RESULT result; unsigned int blocksize; result = FMOD_System_GetDSPBufferSize(gSystem, &blocksize, 0); ERRCHECK(result); if (!paused) { unsigned int pausestart_hi = 0, pausestart_lo = 0; FMOD_System_GetDSPClock(gSystem, &pausestart_hi, &pausestart_lo); FMOD_64BIT_ADD(pausestart_hi, pausestart_lo, 0, blocksize * 2); /* Into the future by 2 mixer blocks. */ printf("/npause BOTH at %d /n", pausestart_lo); /* Make them both pause at exactly the same tick. Mute them both to avoid a click as well. */ FMOD_Channel_SetMute(channel[0], TRUE); FMOD_Channel_SetDelay(channel[0], FMOD_DELAYTYPE_DSPCLOCK_PAUSE, pausestart_hi, pausestart_lo); FMOD_Channel_SetMute(channel[1], TRUE); FMOD_Channel_SetDelay(channel[1], FMOD_DELAYTYPE_DSPCLOCK_PAUSE, pausestart_hi, pausestart_lo); } else { unsigned int syshi, syslo; int count; FMOD_System_GetDSPClock(gSystem, &syshi, &syslo); printf("/nunpause BOTH at %d/n", syslo); for (count = 0; count < 2; count++) { unsigned int starttime_hi, starttime_lo; unsigned int pausetime_hi = 0, pausetime_lo = 0; unsigned int hi = syshi, lo = syslo; FMOD_Channel_GetDelay(channel[count], FMOD_DELAYTYPE_DSPCLOCK_PAUSE, &pausetime_hi, &pausetime_lo); FMOD_Channel_GetDelay(channel[count], FMOD_DELAYTYPE_DSPCLOCK_START, &starttime_hi, &starttime_lo); FMOD_64BIT_ADD(hi, lo, 0, blocksize * 2); /* Push operation into the future by 2 mixer blocks so it doesnt conflict with mixer. */ if (starttime_lo > pausetime_lo) /* Was already playing, unpause immediately. */ { FMOD_64BIT_ADD(hi, lo, starttime_hi, starttime_lo); /* Push forward the delayed start by the gap between starting and pausing */ FMOD_64BIT_SUB(hi, lo, pausetime_hi, pausetime_lo); /* Push forward the delayed start by the gap between starting and pausing */ } printf("restart %d at %d/n", count, lo); FMOD_Channel_SetDelay(channel[count], FMOD_DELAYTYPE_DSPCLOCK_PAUSE, 0, 0); FMOD_Channel_SetDelay(channel[count], FMOD_DELAYTYPE_DSPCLOCK_START, hi, lo); FMOD_Channel_SetMute(channel[count], FALSE); FMOD_Channel_SetPaused(channel[count], FALSE); } }}
开发者ID:chandonnet,项目名称:FTB2015,代码行数:55,
示例15: Java_org_fmod_realtimestitching_Example_cPausevoid Java_org_fmod_realtimestitching_Example_cPause(JNIEnv *env, jobject thiz){ FMOD_RESULT result = FMOD_OK; FMOD_BOOL paused = 0; result = FMOD_Channel_GetPaused(gChannel, &paused); CHECK_RESULT(result); result = FMOD_Channel_SetPaused(gChannel, !paused); CHECK_RESULT(result);}
开发者ID:mperroteau,项目名称:Euterpe,代码行数:11,
示例16: pause_fiend_musicvoid pause_fiend_music(void){ FMOD_BOOL paused; if(!sound_is_on)return; if(strcmp(current_music,"none")==0)return; FMOD_Channel_GetPaused(fmod_music_channel, &paused); if(!paused) { FMOD_Channel_SetPaused(fmod_music_channel, TRUE); }}
开发者ID:arvidfm,项目名称:fiend,代码行数:12,
示例17: MOD_Resumevoid MOD_Resume (void){ if(SND_Initialised == false || SND_MusicChannel.inuse == false) return; if(SND_MusicChannel.paused == true) { result = FMOD_Channel_SetPaused(SND_MusicChannel.channel, false); FMOD_ERROR(result, true, false); SND_MusicChannel.paused = false; }}
开发者ID:infernuslord,项目名称:uqe-quake,代码行数:13,
示例18: FMOD_Channel_SetPausedvoid CSound::Resume(void) { // Check if we have a sound loaded if (!mLoaded) { return; }#if __ENABLE_CFMOD // Check if we have a valid channel if (0 != mpChannel) { // Resume the channel that is playing the sound FMOD_Channel_SetPaused(mpChannel, 0); }#endif}
开发者ID:pandaforks,项目名称:Mirage--,代码行数:13,
示例19: FMOD_Channel_GetPausedvoid FMODSound::play(void){ if (this->_channel) { FMOD_Channel_GetPaused(this->_channel, &(this->_tmp)); } if (this->_tmp == true) FMOD_Channel_SetPaused(this->_channel, false); else FMOD_System_PlaySound(this->_system, FMOD_CHANNEL_FREE, this->_sound, 0, &(this->_channel)); FMOD_Channel_SetVolume(this->_channel, this->_volume);}
开发者ID:antiqe,项目名称:RType,代码行数:13,
示例20: ERRCHECKSound::Sound(const Sound &_sound){ //FMOD_SOUND *temp = *&_sound.sound; this->sound = *&_sound.sound; f_pos = _sound.f_pos; f_vel = _sound.f_vel; *result = FMOD_Channel_Set3DAttributes(channel,&f_pos,&f_vel); ERRCHECK(); *result = FMOD_Channel_SetPaused(channel, true); ERRCHECK(); pos = new Vector(_sound.pos->X_Y_Z[0],_sound.pos->X_Y_Z[1],_sound.pos->X_Y_Z[2]); vel = new Vector(_sound.vel->X_Y_Z[0],_sound.vel->X_Y_Z[1],_sound.vel->X_Y_Z[2]);}
开发者ID:febreez123,项目名称:thenextdimension3D,代码行数:14,
示例21: Play /// starts or continue playing, true if successfull virtual const bool Play(){ if(IsPlaying())return true; if(IsPaused()){ // unpause sound if(mpChannel){ result = FMOD_Channel_SetPaused(mpChannel,false); ERRCHECK(result); } } else { // start playing mpChannel = 0; // alloc channel if(mpSound && mSoundSystem && mSoundSystem->mpSystem){ result = FMOD_System_PlaySound(mSoundSystem->mpSystem, FMOD_CHANNEL_FREE, mpSound, true, &mpChannel); ERRCHECK(result); } // channel free and working? if(mpChannel){ if(mb3D){ // set 3d position and velocity data result = FMOD_Channel_Set3DAttributes(mpChannel, &mlPos, &mlVel); ERRCHECK(result); // set currently set minmax distances SetMinMaxDistance(mfMinDistance,mfMaxDistance); } result = FMOD_Channel_SetPaused(mpChannel,false); ERRCHECK(result); return true; } else return false; } return false; }
开发者ID:ghoulsblade,项目名称:lugreexample,代码行数:37,
示例22: FMOD_Channel_SetPausedvoid Sound::Resume(){ // Check if we have a sound loaded if (!mLoaded) { return; } // Check if we have a valid channel if (0 != mpChannel) { // Resume the channel that is playing the sound FMOD_Channel_SetPaused(mpChannel, 0); }}
开发者ID:NGAEVA,项目名称:2Dgame,代码行数:15,
示例23: resume_all_soundsvoid resume_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_SetPaused(sound_data[i].voice_num,FALSE); sound_data[i].used=0; } }}
开发者ID:arvidfm,项目名称:fiend,代码行数:16,
示例24: Stopvoid Sound::Play(bool bLoop){ // Check if we have a sound loaded if (!mLoaded) { return; } // Stop any previous sound first Stop(); // Check if we are already playing FMOD_System_PlaySound(FMODBridge::Get()->FMODSystem(), FMOD_CHANNEL_FREE, mpSound, true, &mpChannel); FMOD_Channel_SetLoopCount(mpChannel, bLoop ? -1 : 0); FMOD_Channel_SetVolume(mpChannel, mVolume); FMOD_Channel_SetPaused(mpChannel, false);}
开发者ID:NGAEVA,项目名称:2Dgame,代码行数:17,
示例25: CDA_Resumevoid CDA_Resume (void){#ifdef UQE_FMOD_CDAUDIO if(SND_InitialisedCD == false || SND_MusicChannel.inuse == false) return; if(SND_MusicChannel.paused == true) { result = FMOD_Channel_SetPaused(SND_MusicChannel.channel, false); FMOD_ERROR(result, true, false); SND_MusicChannel.paused = false; }#else CDAudio_Resume();#endif}
开发者ID:infernuslord,项目名称:uqe-quake,代码行数:18,
示例26: switchSound::Sound(const char *file, int _mode,Vector &_pos, Vector&_vel, FMOD_SYSTEM *_system, FMOD_RESULT &_result){ system = _system; result = &_result; if(_mode > 1) { mode =_mode = 0; }else { mode = _mode; } switch(_mode) { case SOUND: *result = FMOD_System_CreateSound(system, file, FMOD_DEFAULT, 0, &sound); this->setSoundMode(FMOD_LOOP_OFF); break; case STREAM: *result = FMOD_System_CreateStream(system, file, FMOD_DEFAULT, 0,&sound); this->setSoundMode(FMOD_LOOP_NORMAL); break; } ERRCHECK(); pos = &_pos; vel = &_vel; f_pos.x = pos->X_Y_Z[0]; f_pos.y = pos->X_Y_Z[1]; f_pos.z = pos->X_Y_Z[2]; f_vel.x = vel->X_Y_Z[0]; f_vel.y = vel->X_Y_Z[1]; f_vel.z = vel->X_Y_Z[2]; //*result = channel->set3DAttributes(&f_pos,&f_vel); *result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, true, &channel); ERRCHECK(); *result = FMOD_Channel_Set3DAttributes(channel,&f_pos,&f_vel); ERRCHECK(); *result = FMOD_Channel_SetPaused(channel, true); ERRCHECK();}
开发者ID:febreez123,项目名称:thenextdimension3D,代码行数:44,
示例27: PlayStereoFrequencyvoid PlayStereoFrequency( short player, short which, short freq ){ if( soundOn ) { float oldFreq; FMOD_System_PlaySound( fmodSystem, FMOD_CHANNEL_FREE, sound[which], true, &soundChannel[player] ); // SetPan pans the sound from -1 (full left) to 1 (full right). // which means player 0 should be -1 and player 1 should be 1. // Except hard panning sounds kind of bad so player 0 should be // -0.75 and player 1 should be 0.75. if( playerWindowVisible[1] ) { FMOD_Channel_SetPan( soundChannel[player], -0.75f + 1.5f * player ); } else { FMOD_Channel_SetPan( soundChannel[player], 0.0f ); } FMOD_Channel_GetFrequency( soundChannel[player], &oldFreq ); FMOD_Channel_SetFrequency( soundChannel[player], oldFreq * (16 + freq)/ 16 ); FMOD_Channel_SetPaused( soundChannel[player], false ); }}
开发者ID:torque,项目名称:CandyCrisis,代码行数:20,
示例28: mainint main(int argc, char **argv){ setup_ui(&argc, &argv); FMOD_SOUND *soundtrack; FMOD_CHANNEL *channel1; FMOD_VECTOR position = { 0, 0, 0 }; FMOD_VECTOR velocity = { 0, 0, 0 }; FMOD_VECTOR forward = { 0, 0, 1 }; FMOD_VECTOR up = { 0, 1, 0 }; FMOD_System_Create(&fsystem); FMOD_System_Init(fsystem, 100, FMOD_INIT_NORMAL, NULL); FMOD_System_Set3DSettings(fsystem, 1.0f, 1.0f, 1.0f); FMOD_System_CreateSound(fsystem, argc < 2 ? "../sounds/blast.wav" : argv[1], FMOD_3D | FMOD_LOOP_NORMAL, 0, &soundtrack); FMOD_System_PlaySound(fsystem, soundtrack, NULL, 1, &channel1); FMOD_Channel_Set3DAttributes(channel1, &position, &velocity, NULL); FMOD_Channel_SetPaused(channel1, 0); FMOD_System_Set3DListenerAttributes(fsystem, 0, &position, &velocity, &forward, &up); FMOD_System_Update(fsystem); gtk_main(); /*int i = 0; while (i < 500) { i++; FMOD_System_Update(fsystem); struct timespec sleepTime = { 0, 50 * 1000 * 1000 }; nanosleep(&sleepTime, NULL); }*/ FMOD_Sound_Release(soundtrack); FMOD_System_Close(fsystem); FMOD_System_Release(fsystem);}
开发者ID:tom95,项目名称:TOMSpaceshooter,代码行数:39,
注:本文中的FMOD_Channel_SetPaused函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ FMOD_Channel_Stop函数代码示例 C++ FMF_SetCell函数代码示例 |