microsoft / vscode

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

Voice extension fails when extensions path has non-ASCII characters #206512

Open RafalSkorka opened 7 months ago

RafalSkorka commented 7 months ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

I am using Windows 10 Polish interface, however I have the English (US) configured in Settings -> Speech and two languages installed in Settings -> Language (Anglish and Polish). When trying to use Speech extension I get this error:

2024-02-29 08:58:45.594 [trace] [vscode-speech-0] starting speech-to-text session (language: en-US, model: Microsoft Speech Recognizer en-US FP Model V8.1)
2024-02-29 08:58:45.699 [error] [vscode-speech-0] error: Invalid argument exception: Cannot find an embedded speech recognition model by name "Microsoft Speech Recognizer en-US FP Model V8.1". Check that the arguments for FromPath or FromPaths are valid model paths and SetSpeechRecognitionModel is called with a valid model name.
[CALL STACK BEGIN]

    > recognizer_create_speech_recognizer_from_config
    - recognizer_create_speech_recognizer_from_config
    - 00007FFE65676B44 (SymFromAddr() error: Próbowano uzyskać dostęp do nieprawidłowego adresu.)
    - 00007FFE656781A4 (SymFromAddr() error: Próbowano uzyskać dostęp do nieprawidłowego adresu.)
    - 00007FFE65680E1B (SymFromAddr() error: Próbowano uzyskać dostęp do nieprawidłowego adresu.)
    - 00007FFE656735F5 (SymFromAddr() error: Próbowano uzyskać dostęp do nieprawidłowego adresu.)
    - uv_dlerror
    - uv_dlerror
    - uv_cancel
    - uv_thread_create_ex
    - Cr_z_adler32
    - BaseThreadInitThunk
    - RtlUserThreadStart

[CALL STACK END]

2024-02-29 08:58:45.704 [trace] [vscode-speech-0] disposed speech-to-text session
2024-02-29 08:59:02.906 [trace] [vscode-speech-0] disposing speech-to-text session
bpasero commented 7 months ago

Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

And then please also install the pre-release speech extension

RafalSkorka commented 6 months ago

unfortunately the same results are on the vs code insiders release and the pre-release vs code speech extension (v0.7.2024022820 (pre-release)):

2024-03-05 08:54:10.467 [trace] [vscode-speech-0] starting speech-to-text session (language: en-US, model: Microsoft Speech Recognizer en-US FP Model V8.1)
2024-03-05 08:54:10.569 [error] [vscode-speech-0] error: Invalid argument exception: Cannot find an embedded speech recognition model by name "Microsoft Speech Recognizer en-US FP Model V8.1". Check that the arguments for FromPath or FromPaths are valid model paths and SetSpeechRecognitionModel is called with a valid model name.
[CALL STACK BEGIN]

    > recognizer_create_speech_recognizer_from_config
    - recognizer_create_speech_recognizer_from_config
    - 00007FFA04236B44 (SymFromAddr() error: Attempt to access invalid address.)
    - 00007FFA042381A4 (SymFromAddr() error: Attempt to access invalid address.)
    - 00007FFA04240E1B (SymFromAddr() error: Attempt to access invalid address.)
    - 00007FFA042335F5 (SymFromAddr() error: Attempt to access invalid address.)
    - uv_dlerror
    - uv_dlerror
    - uv_cancel
    - uv_thread_create_ex
    - Cr_z_adler32
    - BaseThreadInitThunk
    - RtlUserThreadStart

[CALL STACK END]

2024-03-05 08:54:10.570 [trace] [vscode-speech-0] disposed speech-to-text session
2024-03-05 08:54:14.569 [trace] [vscode-speech-0] disposing speech-to-text session

One thing I notices is there is a bit different version of Language displayed in the Speech Properties in Control Panel: image v8.0 vs expected v8.1 but I don't know if that matters.

bpasero commented 6 months ago

@RafalSkorka what is your extensions folder, can you "Open Extensions Folder" command:

Image

Is that maybe a network share or UNC path? That is where we would load the model from, specifically from here:

Image

PS: that Windows setting seems unrelated to the speech extension in VS Code, we ship our own model for speech recognition.

RafalSkorka commented 6 months ago

My extensions folder path is (redacted) C:\Users\Some polish name with spaces and ń\.vscode-insiders\extensions I followed your hint and installed code insiders in c:\code\ folder - that didn't help since the extensions were still in the above folder. However there is apparently --extensions-dir command line which, when used, allowed me to successfully work with the speech extension:

2024-03-05 19:55:56.691 [trace] [vscode-speech-2] starting speech-to-text session (language: en-US, model: Microsoft Speech Recognizer en-US FP Model V8.1)
2024-03-05 19:55:56.789 [trace] [vscode-speech-2] started speech-to-text session
2024-03-05 19:55:59.774 [trace] [vscode-speech-2] speech start detected
2024-03-05 19:55:59.775 [trace] [vscode-speech-2] recognizing: Now
2024-03-05 19:56:00.061 [trace] [vscode-speech-2] recognizing: Now it
2024-03-05 19:56:00.106 [trace] [vscode-speech-2] recognizing: Now it is
2024-03-05 19:56:00.274 [trace] [vscode-speech-2] recognizing: Now it is working
2024-03-05 19:56:01.123 [trace] [vscode-speech-2] speech end detected
2024-03-05 19:56:01.123 [trace] [vscode-speech-2] recognized: Now it is working
2024-03-05 19:56:01.975 [trace] [vscode-speech-2] disposing speech-to-text session

The drawback is, the --extensions-dir argument apparently does not change the path permanently, so I would need to specify it each time I run code or find some way it happens always. Anyway thanks for help!

bpasero commented 6 months ago

Thanks, I can reproduce and reported as upstream: https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/2288

ifirdavs commented 5 months ago

Hasn't this issue been resolved yet? Cause I updated the extension and it's still there.