Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session. #31

Open
hari-haran opened this issue Jun 21, 2017 · 2 comments

Comments

@hari-haran
Copy link

2017-06-21 16:41:50.945536+0800 MyApp[4942:1061563] [avas] AVAudioSession.mm:1049:-[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
2017-06-21 16:41:50.990044+0800 MyApp[4942:1061563] Ended
2017-06-21 16:41:50.990108+0800 MyApp[4942:1061563] Error
2017-06-21 16:41:50.990143+0800 MyApp[4942:1061563] {"0":"bad gateway"}

@hpgmiskin
Copy link

Has anyone found a solution to this problem? I am going to have a look into ApiAIPlugin.m. Any help would be much appreciated @xVir. I will create a PR if solved.

@hpgmiskin
Copy link

I gave up and ended up using apiai-javascript-client and cordova-plugin-speechrecognition to achive the same result.

A key component was sending all the matched potentials to API.AI so that it can select the best match based on the intents that are available.

this.speechRecognition.startListening().subscribe((matches) => {
  let confidence = Array(matches.length).fill(1/matches.length);
  this.apiAiClient.textRequest(matches,{confidence:confidence}).then((response) => {
    ...
  });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants