sound->getMusicSpeed returns [FMOD_ERR_FORMAT (19)]

hi,there
It always returns FMOD_ERR_FORMAT when call getMusicSpeed function.I don’t understand where i’m wrong and what’s the reason it is.
Should it be incorrect file format or any other reasons?

BTW:
I created the sound by setting the FMOD_CREATESAMPLE:
system->createSound("…\music\13.aif", FMOD_CREATESAMPLE, NULL, &soundOne);
soundOne->getFormat(&type, &format, &channels, &bits);
returned values:
type==>0x0093ece8 {FMOD_SOUND_TYPE_AIFF (1)}
format==>0x0093ecdc {FMOD_SOUND_FORMAT_PCM16 (2)}

So ,which sound format(s) contains the speed information.It seems that the official document not do this remarks.

You can probably see the issue in the documentation

https://www.fmod.org/docs/content/generated/FMOD_Sound_SetMusicSpeed.html

SetMusicSpeed is for MOD/S3M/XM/IT/MID formats which are ‘music’ formats (sequenced).

Thank you for you advise :slight_smile: @Brett Paterson
But in my opinion, every music should have the speed attribute,isn’t it?

Do you mean pitch or time stretching? The reason it has the word ‘music’ in the function is because its for ‘sequenced’ formats (formats that play notes like midi).

If you wanted time stretching thats a very heavy DSP effect, but you can do something like that with our pitch shifter effect, and then use setPitch to counter the pitch change, which makes the sound play shorter or longer.

It seems that you must setMusicSpeed first,and then getMusicSpeed.
But wait,every music should have the speed attribute,isn’t it??

I do not think that FMOD can get the default speed value of an music.but can get the speed from a bank file on condition that you have add an marker of the event.