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

Support speech recognition and text to speech #49

Merged
merged 12 commits into from
Mar 18, 2024
Merged

Conversation

lynchee-owo
Copy link
Contributor

No description provided.

@lynchee-owo lynchee-owo marked this pull request as draft March 13, 2024 21:48
@mondaychen
Copy link
Contributor

You are using useEffect in the PR. It's probably the most misused hook of React. Although this PR is still in draft, I want to remind you to think about the lifecycle of the effects, and how to make sure the dependency array is carefully set up.

If this is new to you, please spend some time read

@lynchee-owo lynchee-owo marked this pull request as ready for review March 15, 2024 15:52
@lynchee-owo
Copy link
Contributor Author

You are using useEffect in the PR. It's probably the most misused hook of React. Although this PR is still in draft, I want to remind you to think about the lifecycle of the effects, and how to make sure the dependency array is carefully set up.

If this is new to you, please spend some time read

I think for handling the case "run task immediately" when stop listening, could use an alternative approach than creating an event "document.dispatchEvent(new CustomEvent("stopListening"))" and listen it, could rewrite it in the state management way

src/common/TaskUI.tsx Outdated Show resolved Hide resolved
src/common/TaskUI.tsx Outdated Show resolved Hide resolved
src/helpers/voiceControl.ts Outdated Show resolved Hide resolved
src/common/VoiceButton.tsx Outdated Show resolved Hide resolved
src/common/VoiceButton.tsx Outdated Show resolved Hide resolved
@@ -50,6 +60,7 @@ const TaskUI = () => {
instructions: state.ui.instructions,
setInstructions: state.ui.actions.setInstructions,
}));
const [voiceMode, setAudioMode] = useState(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should move this to the settings state since it should be persisted. But if you are working on the settings view as your next task, we can take care of that as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point! I will take care of this during the settings view implementation.

src/common/VoiceButton.tsx Outdated Show resolved Hide resolved
@lynchee-owo lynchee-owo merged commit e437f3b into main Mar 18, 2024
3 checks passed
@mondaychen mondaychen deleted the lynchee/voice branch May 23, 2024 14:28
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