Skip to content

Bugfixes for TTS #390

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

Merged
merged 2 commits into from
Sep 15, 2023
Merged

Bugfixes for TTS #390

merged 2 commits into from
Sep 15, 2023

Conversation

mickael-menu
Copy link
Member

  • Fix issue when computing a substring of a Locator.Text, were the char offsets were incorrect.
  • Fix terminating the current TTS task.
    • Sometimes we received events for a previous task, which interrupted the current task too early. I fixed it by checking for the task ID first.

@mickael-menu mickael-menu requested a review from qnga September 14, 2023 15:45

private fun popTask(id: TtsEngine.RequestId) =
getTask(id)
?.also { currentTask = null }
Copy link
Member

Choose a reason for hiding this comment

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

Is that the important thing? I can't see any difference in the listener, except this. Which call to currentTask happened to receive the wrong task?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. It was onFlushed, which was called with the ID of the previous task than the currentTask one.

As we didn't check the id before setting currentTask = null, it was breaking the playback.

Copy link
Member

@qnga qnga left a comment

Choose a reason for hiding this comment

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

Ok, that looks correct to me.

@mickael-menu mickael-menu merged commit ef8d221 into v3 Sep 15, 2023
@mickael-menu mickael-menu deleted the fix/tts branch September 15, 2023 08:12
OdiSergio added a commit to OdiSergio/kotlin-toolkit that referenced this pull request Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants