Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #13737: Voiceover does not repeat when user submits answer before voiceover has finished #14367

Merged
merged 20 commits into from Jan 27, 2022

Conversation

murraytay
Copy link
Contributor

@murraytay murraytay commented Dec 3, 2021

Overview

  1. This PR fixes or fixes part of Audio mismatch after answering a question #13737.
  2. This PR does the following: Makes sure that when a user submits and answer before the voiceover has finished, the voiceover does not repeat the audio it was playing. This includes two parts: 1) making sure the voiceover moves on to the secondary audio or 2) making sure the voiceover outputs nothing when there is no audio for the secondary text.

Essential Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The linter/Karma presubmit checks have passed locally on your machine.
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)
    • This lets reviewers restart your CircleCI tests for you.
  • The PR is made from a branch that's not called "develop".

Proof that changes are correct

No voiceover for secondary text (make sure first text does not repeat)

no_secondary_audio.mov

Voiceover for secondary text

secondary_audio.mov

PR Pointers

  • Make sure to follow the instructions for making a code change.
  • Oppiabot will notify you when you don't add a PR_CHANGELOG label. If you are unable to do so, please @-mention a code owner (who will be in the Reviewers list), or ask on Gitter.
  • For what code owners will expect, see the Code Owner's wiki page.
  • Make sure your PR follows conventions in the style guide, otherwise this will lead to review delays.
  • Never force push. If you do, your PR will be closed.
  • Oppiabot can assign anyone for review/help if you leave a comment like the following: "{{Question/comment}} @{{reviewer_username}} PTAL"
  • Some of the e2e tests are flaky, and can fail for reasons unrelated to your PR. We are working on fixing this, but in the meantime, if you need to restart the tests, please check the "If your build fails" wiki page.

@oppiabot
Copy link

oppiabot bot commented Dec 3, 2021

Hi @kevintab95, @DubeySandeep -- could one of you please add the appropriate changelog label to this pull request? Thanks!

@murraytay
Copy link
Contributor Author

murraytay commented Dec 3, 2021

Important context:

In this PR I make a fundamental change to the stop audio functionality: instead of simply stopping the track, I mimic the behavior of the on audio track ended callback function and set the currentTrack, filename, and position in file to null and call clearSecondaryAudioTranslations. I think having Stop be similar to 'on end' makes sense but it also may make the distinction between the Stop and Cancel functions irrelevant. Currently, the cancel function calls the stop function and then sets currentTrackFilename and currentTrack to be null, so in the new implementation it never makes sense to call cancel.

Please look to these changes: https://github.com/oppia/oppia/pull/3818/files to see the old implementation of the stop, clear, and on ended functions, which used to look a lot like what my new edits are (stop didn't actually Stop the file, it just set it to null). I am not sure why this change was made, and have made one of my commits just so you can see where Stop is called and why. It is my opinion that none of the current uses of Stop actually require it to behave differently than cancel so it might actually just be a good idea to get rid of cancel.

@oppiabot
Copy link

oppiabot bot commented Dec 5, 2021

Hi @murraytay, the build of this PR is stale and this could result in tests failing in develop. Please update this pull request with the latest changes from develop. Thanks!

@oppiabot oppiabot bot removed the PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. label Dec 7, 2021
@DubeySandeep
Copy link
Member

@kevintab95 Can you please review this PR as a primary reviewer?

@DubeySandeep DubeySandeep removed their assignment Dec 7, 2021
@oppiabot
Copy link

oppiabot bot commented Dec 8, 2021

Hi @murraytay, there is a new change in develop which needs to be in your PR. Please update your branch with the latest changes in develop. For instructions, refer to this link. Thanks!

@murraytay
Copy link
Contributor Author

@kevintab95 would you mind reviewing this PR?

@oppiabot
Copy link

oppiabot bot commented Dec 18, 2021

Hi @murraytay, the build of this PR is stale and this could result in tests failing in develop. Please update this pull request with the latest changes from develop. Thanks!

@murraytay
Copy link
Contributor Author

@DubeySandeep please see my comments to your message!

@oppiabot
Copy link

oppiabot bot commented Jan 2, 2022

Hi @murraytay, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 4 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 4 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale label Jan 2, 2022
@oppiabot oppiabot bot closed this Jan 6, 2022
@Rijuta-s Rijuta-s reopened this Jan 21, 2022
@oppiabot oppiabot bot removed the stale label Jan 21, 2022
@oppiabot oppiabot bot removed the PR: don't merge - STALE BUILD The build on this PR is stale and should be restarted. label Jan 21, 2022
@murraytay murraytay assigned DubeySandeep and unassigned murraytay Jan 21, 2022
@murraytay
Copy link
Contributor Author

PTAL @DubeySandeep

Copy link
Contributor Author

@murraytay murraytay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


this._currentTrack = null;
this._currentTrackFilename = null;
this._lastPauseOrSeekPos = null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so on further inspection it seems to just need the currentTrack.stop() function which I think makes sense without a comment. Let me know what you think!


this._currentTrack = null;
this._currentTrackFilename = null;
this._lastPauseOrSeekPos = null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@oppiabot
Copy link

oppiabot bot commented Jan 27, 2022

Unassigning @DubeySandeep since they have already approved the PR.

@oppiabot oppiabot bot added the PR: LGTM label Jan 27, 2022
@oppiabot
Copy link

oppiabot bot commented Jan 27, 2022

Hi @aks681, this PR is ready to be merged. Author of this PR does not have permissions to merge this PR. Before you merge it, please make sure that there are no pending comments that require action from the author's end. Thanks!

@Rijuta-s Rijuta-s enabled auto-merge (squash) January 27, 2022 14:56
@Rijuta-s Rijuta-s merged commit e246a1c into oppia:develop Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants