Universal Windows TTS with Muse


Hi ,
I wrote my own code with Muse HeadBand, and i want to add TTS (Text to Speech) to my program.
I wrote Something and it doesnt make any sound.
I am attaching the code, if someone can help, i will be glad.

void MainPage::btnTextToSpeech_Click(Platform::Object^ sender,
Windows::UI::Xaml::RoutedEventArgs^ e)

// InitializeComponent();
synthesizer = ref new SpeechSynthesizer();

String^ textToSpeech="Hello";

//textToSpeech = My_Text->Text;

task<SpeechSynthesisStream^>speakTask = create_task(synthesizer->SynthesizeTextToStreamAsync(textToSpeech));

speakTask.then([this, textToSpeech](SpeechSynthesisStream^ speechStream)
	MediaElement^ media = ref new MediaElement();
	media->SetSource(speechStream, speechStream->ContentType);
	media->AutoPlay = true;