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

[Proposal] SpeechToText #808

Closed
8 tasks
VladislavAntonyuk opened this issue Dec 3, 2022 · 2 comments · Fixed by #1127
Closed
8 tasks

[Proposal] SpeechToText #808

VladislavAntonyuk opened this issue Dec 3, 2022 · 2 comments · Fixed by #1127
Assignees
Labels
approved This Proposal has been approved and is ready to be added to the Toolkit champion A member of the .NET MAUI Toolkit core team has chosen to champion this feature documentation approved help wanted This proposal has been approved and is ready to be implemented proposal A fully fleshed out proposal describing a new feature in syntactic and semantic detail

Comments

@VladislavAntonyuk
Copy link
Collaborator

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

@VladislavAntonyuk VladislavAntonyuk added new proposal A fully fleshed out proposal describing a new feature in syntactic and semantic detail labels Dec 3, 2022
@ghost ghost added this to Proposal Submitted in New Feature Proposals Dec 3, 2022
@brminnick brminnick moved this from Proposal Submitted to Proposal Championed in New Feature Proposals Dec 13, 2022
@ghost ghost added champion A member of the .NET MAUI Toolkit core team has chosen to champion this feature and removed new labels Dec 13, 2022
@brminnick
Copy link
Collaborator

Thanks @VladislavAntonyuk!

Promoting to approved This Proposal has been approved and is ready to be added to the Toolkit as we voted to approve it in the December Standup.

Technically, we should've opened the Proposal first before voting to approve said Proposal, but we'll let this one slide.

Submitting a Proposal doesn't require a vote from the core maintainers. It should start as a Discussion, and then once the Discussion is deemed feature-complete a Proposal can be opened.

@brminnick brminnick moved this from Proposal Championed to Proposal Approved in New Feature Proposals Dec 13, 2022
@ghost ghost added approved This Proposal has been approved and is ready to be added to the Toolkit help wanted This proposal has been approved and is ready to be implemented labels Dec 13, 2022
@VladislavAntonyuk VladislavAntonyuk self-assigned this Dec 18, 2022
VladislavAntonyuk added a commit that referenced this issue Apr 4, 2023
VladislavAntonyuk added a commit that referenced this issue Apr 4, 2023
This reverts commit 33d2689.
brminnick added a commit that referenced this issue May 18, 2023
* SpeechToText #808

* Fix Tizen build

* Update Namespace + Method Naming

* Combine Shared Code for iOS + MacCatalyst

* Add `NSSpeechRecognitionUsageDescription` to `Info.plist`

* Update Sample App

* Format code

* `dotnet format`

* Update Windows Error Handling

* Update EssentialsGalleryViewModel.cs

* Add Tizen Implementation

* Revert `SpeechToTextImplementation` to `public`

* SpeechRecognitionResult

* Fix tests

* Fix Tizen

* Remove warnings

* Update Formatting

* Update SpeechToTextImplementation.tizen.cs

* Add microphone permission

* Add support for `MultichannelContent`

* Update the Initialization step for Tizen

* Fix indent

---------

Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com>
Co-authored-by: Jay Cho <chojoong@gmail.com>
@ghost ghost reopened this May 18, 2023
@ghost
Copy link

ghost commented May 18, 2023

Reopening Proposal.

Only Proposals moved to the Closed Project Column and Completed Project Column can be closed.

@brminnick brminnick moved this from Proposal Approved to Pull Request Approved (Pending Documentation) in New Feature Proposals May 18, 2023
@VladislavAntonyuk VladislavAntonyuk moved this from Pull Request Approved (Pending Documentation) to Completed in New Feature Proposals May 27, 2023
@ghost ghost closed this as completed May 27, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This Proposal has been approved and is ready to be added to the Toolkit champion A member of the .NET MAUI Toolkit core team has chosen to champion this feature documentation approved help wanted This proposal has been approved and is ready to be implemented proposal A fully fleshed out proposal describing a new feature in syntactic and semantic detail
Projects
Development

Successfully merging a pull request may close this issue.

2 participants