Author Topic: Get and Set tempo?  (Read 3847 times)

ehead

  • Newbie
  • *
  • Posts: 3
I've looked over the docs and done a forum search, so I'm thinking this may be more a request than a question, but I can't be sure.

I'd love to be able to get and set the tempo via the API. Saw one other person in the forums make this request. Not sure if it's possible and I just don't know how to do it, or if it's not available. If the former, if someone could point me in the right direction that would be awesome! If the later I'd humbly request this be added to the API if possible.

- Cheers

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
its not currently supported but i think can be done at some point for v3.5


ehead

  • Newbie
  • *
  • Posts: 3

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1014
  • Heal The World
In the latest interface file, there is:

public enum MetaDataType
{
     Tempo = 85
}

To retrieve it:   mbApiInterface.Library_GetFileTag(sourceFileUrl, MetaDataType.Tempo);
To set it:   mbApiInterface.Library_SetFileTag(sourceFileUrl, MetaDataType.Tempo, "Moderate");

When setting it, you may need to make use of the following afterwards which does not appear to be documented in the interface file:
mbApiInterface.Library_CommitTagsToFile(sourceFileUrl);
mbApiInterface.MB_RefreshPanels();
Last Edit: December 09, 2023, 05:55:32 AM by Mayibongwe
Favourite song at the moment:   Decode by Paramore