microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.08k stars 28.81k forks source link

Add option to ignore code blocks in text-to-speech #214481

Open doggy8088 opened 3 months ago

doggy8088 commented 3 months ago

The text-to-speech function vocalizes the content within code fences in Copilot's responses, which typically contain code and are not designed for vocalization. Could there be a feature to bypass the code fences in text-to-speech?

VSCodeTriageBot commented 3 months ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

VSCodeTriageBot commented 3 months ago

:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

bpasero commented 1 week ago

Opening up for help wanted. A new setting makes sense to me. Here is where we get the text from the response and send it to the synthesizer:

https://github.com/microsoft/vscode/blob/b0cd9493fadea98992735b8b1cdc2c187c099c23/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts#L825

It would probably require changes in the response model to filter out code pieces.

syson16 commented 1 week ago

Hello! @bpasero. I'm a first time contributor and I would like to work on this.

bpasero commented 1 week ago

Sure go for it 👍

burkus commented 6 days ago

Hey @bpasero I have it working in a rough state (no tests, no settings). Where would I create the new setting? I can't find any settings for speech, would it be chat setting?

bpasero commented 6 days ago

👍 , I suggest to add it to accessibility.voice.*.

burkus commented 6 days ago

👍 , I suggest to add it to accessibility.voice.*.

Where do I create the setting? I've been looking around and I'm confused by how settings are created/stored/updated. Do you have any examples of how a setting is created/accessed?

Would that be added here in speechService.ts:

export const enum AccessibilityVoiceSettingId {
    SpeechTimeout = 'accessibility.voice.speechTimeout',
    AutoSynthesize = 'accessibility.voice.autoSynthesize',
    SpeechLanguage = 'accessibility.voice.speechLanguage',
}

How do I check this setting in the voiceChatActions after I declare it?

bpasero commented 6 days ago

Yeah I would follow along an existing setting such as speechTimeout. Just copy that where you find it in the files.