priya-zha / Software-Engineering-Project

0 stars 2 forks source link

The speech recognizer didn't get destroyed and was carrying over to the next activity. #8

Open sijorejigeorge opened 1 year ago

sijorejigeorge commented 1 year ago

Detailed Description:

After using the speech recognizer in voice_selection activity, it doesn't get properly destroyed, and its operation carries over to the next activity. This issue results in the early termination of the text to speech function.

Steps to Reproduce:

Quickly choose male or female and then click select voice button on the voice selection screen.

Expected Behavior:

The speech recognizer should be properly destroyed or paused when leaving the activity where it is used so that it doesn't interfere with subsequent activities.

Actual Behavior:

The speech recognizer doesn't get destroyed or paused when transitioning to the next activity.

Before Fixing the bug:

https://github.com/priya-zha/Software-Engineering-Project/assets/148432068/a82e95d4-7ca3-4434-a793-2a74ba60b9fd

After Fixing the bug:

https://github.com/priya-zha/Software-Engineering-Project/assets/148432068/898473a7-a9f9-4f96-9913-40f198e7343b

sijorejigeorge commented 1 year ago

The issue was resolved by calling finish() after the user clicks the 'select voice' button and destroying the SpeechRecognizer within the onDestroy() method.

https://github.com/priya-zha/Software-Engineering-Project/blob/70af99f417241357b7f5942bd39e1c2a91e41ec8/app/src/main/java/com/example/se/VoiceSelection.java#L499C1-L516C6

https://github.com/priya-zha/Software-Engineering-Project/blob/70af99f417241357b7f5942bd39e1c2a91e41ec8/app/src/main/java/com/example/se/VoiceSelection.java#L92C11-L103C1