If I understand correctly, the recording is working but the visualizer is not. If that is the case, then what might be the issue is that the Visualizer was not properly instantiated.
The Visualizer class has one public constructor and it calls for an audioSession not a captureSizeRange. See here Visualizer**
**
MediaRecorder does not have a method to get the audioSession from what I can see. In fact it looks like only MediaPlayer or AudioTrack audioSessions can be passed to the Visualizer
From the Visualizer reference docs
- If the session is not 0, the audio from a particular MediaPlayer or AudioTrack using this audio session is visualized
You might be able to get away with using a MediaRecorder if you pass a 0 to the Visualizer. No guarantees, but according to the Visualizer reference docs
- If the session is 0, the audio output mix is visualized
So I would try changing this line
visualizer = new Visualizer(Visualizer.GetCaptureSizeRange()[1]);
to
visualizer = new Visualizer(0);
This might allow you to see the audio output from the MediaRecorder.