Voice: Conflict between react-native-voice and text-to-speech

Created on 6 Dec 2018  路  7Comments  路  Source: react-native-voice/voice

Look here

Most helpful comment

You have to edit Voice.m adding the right category of AVAudioSession:

  • Inside startSpeech you have to add (as first line): [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];

  • Now, inside destroySpeech: [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil]; So, after speech-to-text you have to call the destroy method, then you can play a sound with react-native-tts.

I don't know if this is the right solution, but for me, it works.

All 7 comments

have you tried master?

@sibelius yep! It doesn鈥檛 works. If you want, you can try with my code

Can you post the stack trace?

Solved

@under94 how?

You have to edit Voice.m adding the right category of AVAudioSession:

  • Inside startSpeech you have to add (as first line): [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];

  • Now, inside destroySpeech: [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil]; So, after speech-to-text you have to call the destroy method, then you can play a sound with react-native-tts.

I don't know if this is the right solution, but for me, it works.

@under94 its work, thank you !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AgNm picture AgNm  路  4Comments

tiennguyen9988 picture tiennguyen9988  路  5Comments

inglesuniversal picture inglesuniversal  路  8Comments

dohvis picture dohvis  路  7Comments

B4ckes picture B4ckes  路  5Comments