Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Volume of TTS decreases after recognition on IOS #103

Open
neoffer opened this issue Sep 19, 2019 · 3 comments
Open

Volume of TTS decreases after recognition on IOS #103

neoffer opened this issue Sep 19, 2019 · 3 comments

Comments

@neoffer
Copy link

neoffer commented Sep 19, 2019

I'm developing chatbot with Ionic.

We need a property in this plugin which automatically stops recognition after speech end like Android. And a solution for realtime text displays of recognition on iOS.

The problem: After recognition I send the text to the server and get response audio file from server. I play this audio file, but the volume decreases. And when using headset the volume play on the speaker of phone by default.

@jackie-d
Copy link

Same issue confirmed

@hiunkim
Copy link

hiunkim commented Apr 11, 2020

I faced the same issue and fixed it by changing thee lines of "SpeechRecognition.m" file

First of all as I see, the problem was fixed in new version of plugin (v1.2.0). In my case Im using cordova-plugin-speechrecognition 1.1.2 "Speech Recognition" so I changed these lines:

 AVAudioSession *audioSession = [AVAudioSession sharedInstance];
        [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
        [audioSession setMode:AVAudioSessionModeMeasurement error:nil];
        [audioSession setActive:YES withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:nil];

To

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
              [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker error:nil];
              [audioSession setMode:AVAudioSessionModeDefault error:nil];
              [audioSession setActive:YES withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:nil];

@lingoyak
Copy link

lingoyak commented May 6, 2020

I am using v1.2.0 but some of my Testers are getting the issue on iOS 13+.

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

No branches or pull requests

4 participants