pbakondy / cordova-plugin-speechrecognition

:microphone: Cordova Plugin for Speech Recognition
MIT License
196 stars 117 forks source link

Volume of TTS decreases when reading aloud after speech recognition. (iOS) #23

Closed ndamofli closed 6 years ago

ndamofli commented 7 years ago

I use text to speech along with speech recognition (on iOS). Whenever I invoke a speech recognition, the overall volume of the app decreases (the tts speech is hard to hear).Any ideas?

MitchPateman commented 7 years ago

I have the same problem with my iOS app! Anyone got a fix??? Please HELP! Here's what happened to me:

This is only if you are using the sound from your phone... It works flawlessly with headphones or speakers plugged in.

-Audio is at full volume when I open the app on my iPhone, and then as soon as I push my "Start Speech Recognition" button, the volume goes down to a VERY low level.

-I can manually get the volume back up to about 60% of the original volume by following these steps:

  1. Click the "Start Speech Recognition" button
  2. Swipe up from bottom of iPhone to bring up iOS control centre
  3. Swipe left to see the music and audio controls
  4. At the bottom, tap "iPhone"
  5. Switch the output to "iPhone Speaker" (Which is not available when I first open my app)
nice2seeu commented 6 years ago

I have the same problem, too. HELP!

nice2seeu commented 6 years ago

[session setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker error:&err]; [session setMode:AVAudioSessionModeDefault error:&err];

Finally, I got a solution. In my case, the second line recovered the low volume.

desmeit commented 6 years ago

Hi nice2seeu,

how did you change the code? Did you use an av-audio-session plugin in addition? How can I solve it with Javascript?

Thanks for your help and best regards

narenpublic commented 5 years ago

@pbakondy this appears still to be an issue. I have a new Ionic 4 app using the plugin and if I play TTS when the app starts up it plays at a normal level. Once speech recognition is called and then TTS is played again, the volume sounds like it is cut in half. This is 1.2.0

neoffer commented 4 years ago

Problem still continues. Any solution?

jackie-d commented 4 years ago

I confirm the same. Has the pointed fix (also related in other "volume" on this issues tracker) has been properly merged and distributed on the latest npm release?

Thanks

jackie-d commented 4 years ago

I report a workaround that is to play an empty string '' everytime before playing the right phrase.