Answered by:
Could not find speechSynthesisStream.position for finding the position

Question
-
Hi,
While building a metroapp,used speech synthesis class to speak out the text that is given as input in the textbox.
and found play and pause events but no way resume event.
While trying to figure out a way to handle resume, found position property, but could not able to write it in the code.
The problem is when user pauses and then again clicks on play it starts from the beginning.
below is my code snippet used
could some one tell me how to handle resume event.
synth.synthesizeTextToStreamAsync(txtData.value).then(function (markersStream) { // Convert the stream to a URL Blob. var blob = MSApp.createBlobFromRandomAccessStream(markersStream.ContentType, markersStream); audio.src = URL.createObjectURL(blob, { oneTimeOnly: true }); markersStream.seek(0); audio.autoplay = Boolean(true); audio.onplay = function () { statuslabel.innerHTML = "playing"; }; audio.onended = function () { statuslabel.innerHTML = "Finished"; document.getElementById("Speak").disabled = false; synth.close(); }; audio.onpause = function () { statuslabel.innerHTML = "Finished"; // var abc = }; audio.play();
Trying to findout a way to know the position of the text till spoken out, so that i could provide it as input for markersStream.seek(0); so that on resume it continues to play from the remaining.
It could be helpful if there is any better way of doing the same.
Thanks & Regards Tejaswi Chandrapatla
- Moved by Ryan BolzMicrosoft employee Thursday, October 17, 2013 7:26 PM per 8.1 launch
Wednesday, October 16, 2013 2:15 PM
Answers
-
You should just call Play and it will start from where you paused.
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)- Marked as answer by Jamles HezModerator Monday, October 28, 2013 9:37 AM
Friday, October 18, 2013 1:43 PMModerator
All replies
-
Hi Teja,
I don't understand what this means: "findout a way to know the position of the text till spoken out"
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)Thursday, October 17, 2013 7:47 PMModerator -
HI Jeff,
I want to handle play,pause,resume events during speech synthesis.
I could not find Resume event directly. So what I'm thinking is when user pauses the audio, some way to find out till where the text is played, so that i could give the input to stream from there when he clicks on resume button.
If there is any other way to handle resume events,please let me know.
Thanks & Regards Tejaswi Chandrapatla
Friday, October 18, 2013 2:33 AM -
You should just call Play and it will start from where you paused.
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)- Marked as answer by Jamles HezModerator Monday, October 28, 2013 9:37 AM
Friday, October 18, 2013 1:43 PMModerator