uwp Speech Recognition
Asked Answered
N

2

3

I made a simple UWP application to test speech recognition function, But I have some error, it shows: enter image description hereSystem.UnauthorizedAccessException: 'Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))'

  public sealed partial class MainPage : Page
{

    public MainPage()
    {
        this.InitializeComponent();
    }

    SpeechRecognizer recognizer = new SpeechRecognizer();


    private async void Record_Click(object sender, RoutedEventArgs e)
    {

        var topUserLanguage = GlobalizationPreferences.Languages[0];
        var language = new Language(topUserLanguage);
        recognizer = new SpeechRecognizer(language);
        await recognizer.CompileConstraintsAsync();

        recognizer.Timeouts.InitialSilenceTimeout = TimeSpan.FromDays(1);

        var recordResult = await this.recognizer.RecognizeAsync();

        result.Text = recordResult.Text;


    }



}
Never answered 10/7, 2017 at 9:38 Comment(1)
Have you given the microphone capability to your app?Nikethamide
D
5

Right click the Package.appxmanifest in the solution explorer panel to enable microphone capaility

Diella answered 4/8, 2017 at 6:11 Comment(0)
S
1

Go to settings -> Privacy and security -> Speech and enable online speech recognition, that should do it!

Snore answered 27/9, 2021 at 15:7 Comment(6)
please mark as answer or upvote if it helped!Snore
A previous answer was already accepted four years ago, so I wouldn't expect the OP to reassign that at this point.Furness
..... ok but that's quite rude of uSnore
I’m just setting your expectations. Only the OP can change the accepted answer, and it seems the OP’s question was already answered to their satisfaction. Generally, I wouldn’t expect an OP to change the accepted answer unless the original answer is demonstrated to (no longer) be incorrect, or you offer a significantly better answer. Neither case seems to be true here. Even then, though, it would be at the OP’s discretion.Furness
If you’re looking to build reputation, I’d recommend finding newer questions which don’t yet have an accepted answer and you have something new and significant to add over any existing answers. Stack Overflow offers tools for filtering question by answer status to make that easier.Furness
ok.. I guess I misunderstood you then! thanks for the tipSnore

© 2022 - 2024 — McMap. All rights reserved.