DetectionAPI supports mono Wav only

别来无恙 提交于 2019-12-02 16:36:51

问题


I am working on a clap detection android app. i am using musicg api for this.

I imported the project from github and run on android device. then this error shows - DetectionAPI supports mono Wav only

the detail LogCat is-

DetectionAPI supports mono Wav only
java.lang.NullPointerException: Attempt to invoke virtual method 'int com.musicg.wave.WaveHeader.getBitsPerSample()' on a null object reference
at com.musicg.api.DetectionApi.isSpecificSound(DetectionApi.java:80)
at com.musicg.api.WhistleApi.isWhistle(WhistleApi.java:54)
at com.musicg.demo.android.DetectorThread.run(DetectorThread.java:106)
at java.lang.Thread.run(Thread.java:818)

Do anyone have any suggestion how to solve this ?


回答1:


supports mono Wav only

You should record as a wav file as api mentioned. I would recommend you to check musicg_android_demo sources.



来源:https://stackoverflow.com/questions/37925382/detectionapi-supports-mono-wav-only

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