getmusicbee.com

Support => Developers' Area => MusicBee API => Topic started by: DJ MADEST on August 30, 2019, 01:32:58 PM

Title: [C#] NowPlaying_GetSoundGraph() get array size
Post by: DJ MADEST on August 30, 2019, 01:32:58 PM
how to get float[] array size for NowPlaying_GetSoundGraph()?

i trying this code but it always return false

Code
var graph = new List<float>();
bool ok = mbApiInterface.NowPlaying_GetSoundGraph(graph.ToArray());
Title: Re: [C#] NowPlaying_GetSoundGraph() get array size
Post by: Steven on August 31, 2019, 09:32:00 AM
you need to declare graph as an array already sized appropriately
Code
float[] graph = new float[500]
bool ok = mbApiInterface.NowPlaying_GetSoundGraph(graph);
or
float[] graph = new float[500]
float[] peak = new float[500]
bool ok = mbApiInterface.NowPlaying_GetSoundGraphEx(graph, peak);