Author Topic: [C#] NowPlaying_GetSoundGraph() get array size  (Read 3697 times)

DJ MADEST

  • Newbie
  • *
  • Posts: 9
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());

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
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);