public class LevelMeter : MonoBehaviour {
public int monitoredChannelId = 0;
private int analyzedDspBusId = 0;
private float objScaleBaseVal = 2.0f;
void Start () {
CriAtom.AttachDspBusSetting("DspBusSetting_0");
CriAtom.SetBusAnalyzer(true);
}
void Update(){
CriAtomExAsr.BusAnalyzerInfo lBusInfo = CriAtom.GetBusAnalyzerInfo(analyzedDspBusId);
float lObjScaleNewVal = 0.1f + objScaleBaseVal * lBusInfo.peakLevels[monitoredChannelId];
Debug.Log("Channel_" + monitoredChannelId + " : " + lBusInfo.peakLevels[monitoredChannelId]);
this.transform.localScale = new Vector3(lObjScaleNewVal, lObjScaleNewVal, lObjScaleNewVal);
}
}