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.
The issue was resolved by calling finish() after the user clicks the 'select voice' button and destroying the SpeechRecognizer within the onDestroy() method.
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