简体   繁体   中英

Music file rhythm and intensity detection on Xamarin.Forms

Our product is a dimmable light bulb, connected via Bluetooth and App, App can adjust the brightness (color) of the bulb, the brightness value is 1-100.

Now the App wants to add a function that automatically dims according to music (Mp3). While playing music, it automatically adjusts the brightness of the light according to the rhythm and sound size of the music.

The music has been played using https://github.com/adrianstevens/Xamarin-Plugins/tree/master/SimpleAudioPlayer

My question is, when playing music (Mp3), how do I convert the rhythm and intensity of the music to a 1-100 number and send it as a brightness value to the light bulb?

A lot of C# (Windows-based) music analysis examples were found online, but Xamarin was not found.

Thank you for your help!

Sounds cool! There are two parts to your problem,

  • Enhancing the audio player - Since you have implemented the Audio Player already, all you need to do is add a Value changed event to the slider, as shown in this official Microsoft Example , so that changing the value of the slider will now also communicate with your device/bulb

  • Communicating with your device - This will depend on how your device accepts values over bluetooth. We wouldn't be able to know for sure what serial values your bulb is accepting, but you have to send serial data values through bluetooth. You can use this to help simplify with this part.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM