Software Archive
Read-only legacy content
17061 ディスカッション

Voice Recognition and command tags

steve-vink
ビギナー
756件の閲覧回数

Looking at the demo application for voice recognition, there are tags available on commands, it iterates through them and reports them back to the form.

But if I create a grammar file for commands and add a tag, it fails to load. So this is OK:

public <play> = (play [(video | movie)]);

But this causes a loading error:

public <play> = (play [(video | movie)]) {play};

 

Is this a bug or not fully implemented? Without tags, voice commands become much harder to process.

0 件の賞賛
4 返答(返信)
steve-vink
ビギナー
756件の閲覧回数

Here is the description from the JSGF specification:

 

Tags can simplify the writing of applications by simplifying the processing of recognition results. The content of tags, and the use of tags are entirely up to the discretion of the developer.

One important use of tags is in internationalizing applications. The following are examples of rule definitions for four grammars, each for a separate language. The application loads the grammar for the language spoken by the user into an appropriate recognizer. The tags remain the same across all languages and thus simplify the application software that processes the results. Typically, the grammar name will include the language identifier so that it can be programmatically located and loaded.

In the English grammar:

<greeting>= (howdy | good morning) {hi};

In the Japanese grammar:

<greeting>= (ohayo | ohayogozaimasu) {hi};

In the German grammar:

<greeting>= (guten tag) {hi};

In the French grammar:

<greeting>= (bon jour) {hi};
steve-vink
ビギナー
756件の閲覧回数

I've spent today setting up voice recognition comands, mainly to familiarise myself with the way sessions and modules are configured.

One thing I spotted was that the demo is set to not use JSGF files, which I thought would explain my problems with tags. However, having changed the parameter, it still doesn't work. What it does do, is disable the camera!

So no luck on this front, but hopefully it saves others from going through the same pain.

 

Michail_S_Intel
従業員
756件の閲覧回数

Hello, steve-vink.

Could you share full text of .jsgf file?

But, Looks like "public <play> = (play [(video | movie)]) {play};"

"play" cannot be used for tag and name at the same time. Try to  write:  "public <play> = (play [(video | movie)]) {Play};"

 

steve-vink
ビギナー
756件の閲覧回数

Apologies for the delay in responding

Your advice is correct, the label and tags need to be different, and are case-sensitive. This works:

public <play> = (play [(video | movie)]) {PLAY}; 
public <select> = (select [(video | movie)]) {SELECT}; 
public <pause> = (pause [(video | movie)]) {PAUSE};

However I'm still a bit confused. The tag value returns this:

"{ \"tags\" : { \"player#SELECT\" : \"select\" } }"

Which I guess reduces to :

{ "tags" : { "player#SELECT" : "select" } }

I was expecting to see just "SELECT" which would be so much easier to capture in code.

 

返信