Android Error code -3 when initializing Visualizer

血红的双手。 提交于 2019-12-07 12:12:30

问题


Got this error while initializing Visualizer

visualizer = new Visualizer(mediaPlayer.getAudioSessionId()); <----

Error: Cannot initialize Visualizer engine, error: -3 java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -3

NB : This is only happening in Marshmallow


回答1:


Got the cause of the problem !!!

This is caused for dynamic permission problem for Marshmallow.

It requires RECORD_AUDIO permission to initialize it.

I need to give permission Manifest.permission.RECORD_AUDIO before initialize the visualizer.



来源:https://stackoverflow.com/questions/35498734/android-error-code-3-when-initializing-visualizer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!