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

AVSpeechSynthesizer does not speak after using SFSpeechRecognizer #22

Open
pratomchaip opened this issue Apr 20, 2017 · 3 comments
Open

Comments

@pratomchaip
Copy link

Hi,

When I use your TTS library and then use a different library with SFSpeechRecognizer that uses audioSession setCategory:AVAudioSessionCategoryRecord... and then I try to use your TTS library again... it doesn't seem to work.

It seems as though the audioSession's Category is still set to AVAudioSessionCategoryRecord.

Do you know if there is a way to reset the audioSession's category to AVAudioSessionCategoryPlayback before running your Tts.speak method or any other way to get your library to work after/before using SFSpeechRecognizer

Thanks.

@ak1394
Copy link
Owner

ak1394 commented Apr 20, 2017

I don't have a clean solution for this right now, but you might try a workaround. The Tts.setDucking(true) call which has been added to the new 1.3.0 release, will set category to AVAudioSessionCategoryRecord, so you might try calling it after using SFSpeechRecognizer. Let me know if it works for you.

@pratomchaip
Copy link
Author

Hi. Sorry for the late reply.

Been testing it out. New setDucking method is great, although AVAudioSessionCategoryPlayback doesn't seem to work.

However, after a few tests, it seems as though AVAudioSessionCategorySoloAmbient works great, which looking at the Apple Docs, seems to be the 'default' category setting.

Would you be able to update the library to use AVAudioSessionCategorySoloAmbient, instead of AVAudioSessionCategoryPlayback, in the setDucking method, please?

// TextToSpeech.m
[session setCategory:AVAudioSessionCategorySoloAmbient

For those who are interested, I'm calling the setDucking before the speak method:

Tts.setDucking(true).then(() => {
  Tts.speak('hello')
}

@pratomchaip
Copy link
Author

pratomchaip commented Apr 28, 2017

PR: #23

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