boolean I_SetSongSpeed(float speed) { FMOD_RESULT e; float frequency; if (!music_stream) return false; if (speed > 250.0f) speed = 250.0f; //limit speed up to 250x #ifdef HAVE_LIBGME // Try to set GME speed if (gme) { gme_set_tempo(gme, speed); return true; } #endif // Try to set Mod/Midi speed e = FMOD_Sound_SetMusicSpeed(music_stream, speed); if (e == FMOD_ERR_FORMAT) { // Just change pitch instead for Ogg/etc. FMR(FMOD_Sound_GetDefaults(music_stream, &frequency, NULL, NULL, NULL)); FMR_MUSIC(FMOD_Channel_SetFrequency(music_channel, speed*frequency)); } else FMR_MUSIC(e); return true; }
void bmx_gme_set_tempo(MaxMusicEmu * emu, double tempo) { gme_set_tempo(emu->emu, tempo); }
void Music_Player::set_tempo( double tempo ) { suspend(); gme_set_tempo( emu_, tempo ); resume(); }