Skip to content

[Proposal] SpeechToText #808

@VladislavAntonyuk

Description

@VladislavAntonyuk

Feature name

SpeechToText

Link to discussion

#727

Progress tracker

  • Android Implementation
  • iOS Implementation
  • MacCatalyst Implementation
  • Windows Implementation
  • Tizen Implementation
  • Unit Tests
  • Samples
  • Documentation

Summary

Free Speech recognition functionality that is available online and offline.

More details with samples at https://vladislavantonyuk.azurewebsites.net/articles/Speech-recognition-with-.NET-MAUI

Motivation

.NET MAUI has TextToSpeech. It's time to convert SpeechToText

Detailed Design

https://developer.apple.com/documentation/speech
https://developer.android.com/reference/android/speech/SpeechRecognizer
https://learn.microsoft.com/en-us/uwp/api/windows.media.speechrecognition?view=winrt-22621

public interface ISpeechToText: IAsyncDisposable { Task<bool> RequestPermissions(CancellationToken cancellationToken); Task<string> Listen(CultureInfo culture, IProgress<string>? recognitionResult, CancellationToken cancellationToken); }

Usage Syntax

var isAuthorized = await speechToText.RequestPermissions();	if (isAuthorized)	{	try	{	RecognitionText = await speechToText.Listen(CultureInfo.GetCultureInfo(Locale?.Language ?? "en-us"), new Progress<string>(partialText =>	{	RecognitionText += partialText + " ";	}), cancellationToken);	}	catch (Exception ex)	{	await Toast.Make(ex.Message).Show(cancellationToken);	}	}	else	{	await Toast.Make("Permission denied").Show(cancellationToken);	}

Drawbacks

No response

Alternatives

No response

Unresolved Questions

No response

Metadata

Metadata

Labels

approvedThis Proposal has been approved and is ready to be added to the ToolkitchampionA member of the .NET MAUI Toolkit core team has chosen to champion this featuredocumentation approvedhelp wantedThis proposal has been approved and is ready to be implementedproposalA fully fleshed out proposal describing a new feature in syntactic and semantic detail

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions