我有一个MediaPlayer服务。我试图用这段代码来想象它:
public void initVisualizer() {
mVisualizerView = new VisualizerView(this);
mVisualizer = new Visualizer(FeatherPlayer.getAudioSessionId());
mVisualizer.setCaptureSize(Visualizer.getMaxCaptureRate());
mVisualizer.setDataCaptureListener(new Visualizer.OnDataCaptureListener() {
public void onWaveFormDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate)
{
mVisualizerView.updateVisualizer(bytes);
}
public void onFftDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate)
{}
}, Visualizer.getMaxCaptureRate(), true, true);
mVisualizer.setEnabled(true);
}
但它显示了黑色的screem而不是可视化。所有权限都授予我的应用。请帮我看看MediaPlayer!
P.S。请原谅我糟糕的英语,请