Answered by:
[WPSL]Speech Recognizer Grammars

Question
-
Firstly, am I correct in thinking that there is no GrammarBuilder in the WP8 sdk ?
I've looked at SRGS XML but find it rather baffling. I don't suppose there is some kind of graphical grammar builder that can create the definitions for me ?
Anyway here's what I need to recognise... A 'sentence' featuring a Number, an Instruction and a Color.
Such as "12.5 Top Red" or "230 Left Blue"
I can recognise each element individually by using AddGrammarFromList but have to pause between each word.
Any ideas ?
- Edited by Franklin ChenMicrosoft employee Wednesday, May 4, 2016 5:33 AM Subject
Monday, April 25, 2016 11:49 AM
Answers
-
Hi theresonlyonefinmaf,
>>Is the GrammarBuilder in 8.1 ?
We cannot use the GrammarBuilder in the Windows Phone8.1, because it is not supported.
>>Not boring but baffling (not easy to understand)
But currently it seems that we need to use the SRGS XML to implement your requirement. Because the SRGS grammars provide a full set of features to help you architect complex voice interaction with our apps. For example, with SRGS grammars we can specify the order in which words and phrases must be spoken to be recognized and we can also combine words from multiple lists and phrases to be recognized. For the detailed information, I will recommend you refer to the following articles to help you better understand about the SRGS grammars:
#SRGS grammars for Windows Phone 8:
https://msdn.microsoft.com/en-us/library/windows/apps/jj207051(v=vs.105).aspx#How to Create a Basic XML Grammar:
https://msdn.microsoft.com/en-us/library/hh361658 .#Adding, loading, and preloading grammars for Windows Phone 8:
https://msdn.microsoft.com/en-us/library/windows/apps/jj206964(v=vs.105).aspxBesides, the following official sample may help you get started with your requirement:
# Speech for Windows Phone: Speech recognition using a custom grammar:
https://code.msdn.microsoft.com/windowsapps/Speech-for-Windows-Phone-3771fc6d .
Best Regards, Sunteen Wu
- Edited by Sunteen Wu Thursday, May 5, 2016 9:49 AM
- Edited by Amy PengMicrosoft employee Thursday, May 5, 2016 9:52 AM edit
- Proposed as answer by Sunteen Wu Monday, May 9, 2016 5:59 AM
- Marked as answer by Barry Wang Tuesday, May 10, 2016 1:45 AM
Thursday, May 5, 2016 2:21 AM
All replies
-
Hi theresonlyonefinmaf,
Firstly, for the GrammarBuilder class, from this article https://msdn.microsoft.com/en-us/library/system.speech.recognition.grammarbuilder(v=vs.110).aspx,
there is no version support for windows phone 8.
Then can I confirm that you are developing a windows phone 8 application,not windows phone 8.1 , right? And you don't want to use SRGS grammars https://msdn.microsoft.com/en-us/library/windows/apps/jj207051(v=vs.105).aspx to meet your requirements since you think it is boring, right?
And are you using the List grammars?
Best Regards, Sunteen Wu
- Proposed as answer by Franklin ChenMicrosoft employee Wednesday, May 4, 2016 5:33 AM
- Unproposed as answer by Franklin ChenMicrosoft employee Thursday, May 5, 2016 3:07 AM
- Edited by Sunteen Wu Thursday, May 5, 2016 9:54 AM
Tuesday, April 26, 2016 9:18 AM -
Not boring but baffling (not easy to understand)
Is the GrammarBuilder in 8.1 ?
Wednesday, May 4, 2016 3:14 PM -
Hi theresonlyonefinmaf,
>>Is the GrammarBuilder in 8.1 ?
We cannot use the GrammarBuilder in the Windows Phone8.1, because it is not supported.
>>Not boring but baffling (not easy to understand)
But currently it seems that we need to use the SRGS XML to implement your requirement. Because the SRGS grammars provide a full set of features to help you architect complex voice interaction with our apps. For example, with SRGS grammars we can specify the order in which words and phrases must be spoken to be recognized and we can also combine words from multiple lists and phrases to be recognized. For the detailed information, I will recommend you refer to the following articles to help you better understand about the SRGS grammars:
#SRGS grammars for Windows Phone 8:
https://msdn.microsoft.com/en-us/library/windows/apps/jj207051(v=vs.105).aspx#How to Create a Basic XML Grammar:
https://msdn.microsoft.com/en-us/library/hh361658 .#Adding, loading, and preloading grammars for Windows Phone 8:
https://msdn.microsoft.com/en-us/library/windows/apps/jj206964(v=vs.105).aspxBesides, the following official sample may help you get started with your requirement:
# Speech for Windows Phone: Speech recognition using a custom grammar:
https://code.msdn.microsoft.com/windowsapps/Speech-for-Windows-Phone-3771fc6d .
Best Regards, Sunteen Wu
- Edited by Sunteen Wu Thursday, May 5, 2016 9:49 AM
- Edited by Amy PengMicrosoft employee Thursday, May 5, 2016 9:52 AM edit
- Proposed as answer by Sunteen Wu Monday, May 9, 2016 5:59 AM
- Marked as answer by Barry Wang Tuesday, May 10, 2016 1:45 AM
Thursday, May 5, 2016 2:21 AM