Search code examples
javaspeech-recognitiongrammarspeech-to-textcmusphinx

how to manage hello.gram for conversation using sphinx and freetts in java


I am developing small voice based interaction tool using sphinx (Speech to Text) and FreeTTS(Text to Speech) in java.

for eg : FreeTTS gives voice command like Name : user will reply his name and age and place.everything is static.

How to write hello.gram in sphinx to achieve this

public<greet>=[<name>] [<age>] [<place>];
<name> = john | max;
<age> = ten | nine ;
<place> = France | Spain;

Voice command : What is your name my reply : Max

Observation : Max ten

Voice command : what is your age my reply : nine

Observation : nine France

I want only names should be observed when i say name.its highly intermittent too :(

Thanks in advance.

modified based on Alexander's answer.


Solution

  • You can use below code to avoid it .

    public <name> = john | max;
    public <age> = ten | nine ;
    public <place> = France | Spain;