Can't access microphone while running Dialog demo in sphinx4 5prealpha

前端 未结 4 1695
长发绾君心
长发绾君心 2021-01-12 04:23

I am trying to run the dialog demo of sphinx 4 pre aplha but it gives errors.

I am creating a live speech application.

I imported the project using maven and

4条回答
  •  轮回少年
    2021-01-12 04:41

    If you modify SpeechSourceProvider to return a constant microphone reference, it won't try to create multiple microphone references, which is the source of the issue.

    public class SpeechSourceProvider {
        private static final Microphone mic = new Microphone(16000, 16, true, false);
    
        Microphone getMicrophone() {
            return mic;
        }
    }
    

    The problem here is that you don't want multiple threads trying to access a single resource, but for the demo, the recognizers are stopped and started as needed so that they aren't all competing for the microphone.

提交回复
热议问题