Skip to content

SpeechSynthesizer takes forever to synthesize. #8269

Answered by DarranRowe
AkiraVoid asked this question in Q&A
Discussion options

You must be logged in to vote

MediaPlayer and SpeechSynthesizer are under the Windows root namespace. They are in the namespaces Windows.Media.Playback and Windows.Meedia.SpeechSynthesis respectively. This means they are part of Windows' functionality and therefore this isn't really the correct place to ask this.

However, I did mess around a little to see if I could get something working, and:

winrt::Windows::Foundation::IAsyncAction main_window::speak_async(const winrt::hstring &language, const winrt::hstring &text)
{
	if (m_current_source != nullptr)
	{
		m_current_source = nullptr;
	}
	auto synth = winrt::Windows::Media::SpeechSynthesis::SpeechSynthesizer();

	auto voices = synth.AllVoices();
	for (const auto &voic…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@AkiraVoid
Comment options

@pjmlp
Comment options

@AkiraVoid
Comment options

@DarranRowe
Comment options

Answer selected by AkiraVoid
Comment options

You must be logged in to vote
2 replies
@AkiraVoid
Comment options

@castorix
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants