getmusicbee.com

Support => Developers' Area => Topic started by: ehead on January 16, 2022, 03:56:43 PM

Title: Get and Set tempo?
Post by: ehead on January 16, 2022, 03:56:43 PM
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
Title: Re: Get and Set tempo?
Post by: Steven on January 17, 2022, 11:19:17 AM
its not currently supported but i think can be done at some point for v3.5
Title: Re: Get and Set tempo?
Post by: ehead on January 17, 2022, 05:27:52 PM
That would be great!
Title: Re: Get and Set tempo?
Post by: ehead on December 08, 2023, 02:34:44 AM
Curious if this ever got implemented?
Title: Re: Get and Set tempo?
Post by: Mayibongwe on December 09, 2023, 05:22:05 AM
In the latest interface file (https://getmusicbee.com/forum/index.php?topic=1972.0), 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();