LibMuse with Unity - reading specific data as floats

musedeveloper

#1

I have got LibMuse working with Unity to the point where I am able to connect to my iOS device, connect a 2016 model headband, and stream data packets to the phone.

However, I am struggling to find a way to read the data from specific packets (such as ALPHA and EEG) and convert them to float values in C#.

I find the documentation on this very sparse, if not confusing. Any suggestions?


#2

Right, so I finally figured out how it all works now.

When you receive the DataPackets they are sent as strings, however, they are in fact .JSONs which you can revert back into C# types with the function JsonUtility.FromJson in Unity.

Here are the docs on this: https://docs.unity3d.com/Manual/JSONSerialization.html

Message me if you need help.