How do I pass float array pointers to Volumemeter

118 views Asked by At

I am trying to use the SharpDX VolumeMeter in Xaudio2. I want to use SetEffectParameters to pass a VolumeMeterLevels object but the object only has a public int ChannelCount and not the two pointers that are noted in the MSDN section. The API lists them as internal.

I need to pass the two pointers for pPeakLevels and pRMSLevels. How can I do this?

Updated with code. Below I create a new VolumeMeter, MasteringVoice and VolumeMeterDescriptor. I set the VolumeMeter in the effect chain of the MasteringVoice.

        Xaudio2Engine = new XAudio2();
        Xaudio2Engine.StartEngine();

        MVoice = new MasteringVoice(Xaudio2Engine, XAudio2.DefaultChannels, XAudio2.DefaultSampleRate, DIString);
        VMeter = new VolumeMeter();

        EffectDescriptor VMeterDescriptor = new EffectDescriptor(VMeter, MVoice.VoiceDetails.InputChannelCount);
        MVoice.SetEffectChain(VMeterDescriptor);

The problem is that VolumeMeter has two non-public properties PeakLevelPointer and RmsLevelsPointer which according to the API (http://sharpdx.org/documentation/api/t-sharpdx-xaudio2-fx-volumemeterlevels) have to be allocated by the application. The VolumeMeter will then fill the float arrays to which the pointers point to make the meter work. The question is: how can I pass the two non-public pointers?

1

There are 1 answers

0
WJM On BEST ANSWER

Contacted support at SharpDX. They have currently not implemented VolumeMeter.