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

DJ MADEST

  • Newbie
  • *
  • Posts: 8
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
  • Hero Member
  • *****
  • Posts: 29770
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);