How FMOD get the speed or BPM of an music


(krisliu) #1

how can i get the sound speed or bpm and the beat.

Sound::getMusicSpeed can not get the speed of an music,and FMOD_RESULT is FMOD_ERR_FORMAT.

this is my piece of code:
result = FMOD_System_CreateSound(system, firstpullpath, FMOD_CREATESAMPLE, 0, &firstsound);
if (result != FMOD_OK)
{
printf(“FMOD_System_CreateSound:%d\n”, result);
return 0;
}
result = FMOD_System_PlaySound(system, firstsound, 0, 0, &channelone);
FMOD_System_Update(system);
float speed;
result = FMOD_Sound_GetMusicSpeed(firstsound, &speed);
printf(“sound speed:%f\n”, speed);

So,how to get the speed of an music not only .bank file,but also other music file format


(Andrew Scott) #2

FMOD doesn’t have beat detection capability built-in. I suggest you google “beat detection” as a good starting point for implementing your own beat detection system.


(Kris Lau) #3

@Andrew Scott thank you for your suggestion