jjordanoc / azure_speech_recognition_null_safety

A Flutter plugin that enables interaction with the Azure Cognitive Services Speech-To-Text API
GNU General Public License v3.0
11 stars 13 forks source link

Continuous Assessment is causing conflicts with audio player on iOS #18

Open hchaviano opened 6 months ago

hchaviano commented 6 months ago

Hello there!, I'm facing an issue on iOS after using the continuousRecordingWithAssessment function I can't use the audio player again, to me seems to be related to some kind of conflicts between the audio and the recording, I'm using the stopContinuousRecognition function to stop the recording, but I think that I'm missing something.

Thanks!

PS: Android works fine

suryaoktana commented 3 months ago

same here with me, after having continuous recognition turned on the app cannot play any audio even after stopping the continous recognition. It needs to restart the app before I could play audio again.

iOS simulator works fine but sadly not in iOS physical device

hchaviano commented 3 months ago

same here with me, after having continuous recognition turned on the app cannot play any audio even after stopping the continous recognition. It needs to restart the app before I could play audio again.

iOS simulator works fine but sadly not in iOS physical device

I found a work-around using audio_session package, if you want to play audio after using continuos recognition you just need to add this code:

/// Create audio_session instance
final _audioSession = await AudioSession.instance;

/// Configure audio session to play audio
 Future<void> _configurePlayer() async {
    await _audioSession.configure(const AudioSessionConfiguration.music());
    await _audioSession.setActive(true);
  }