Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with ASR and the :native_or_unimrcp renderer #223

Open
Jared-Prime opened this issue May 23, 2014 · 13 comments
Open

Problems with ASR and the :native_or_unimrcp renderer #223

Jared-Prime opened this issue May 23, 2014 · 13 comments

Comments

@Jared-Prime
Copy link
Contributor

Following up on a recent email and submitting an issue as suggested, I'd like to clarify what we need at Ifbyphone.

Preamble

We know we have these options available to us:

  • recognizers :unimrcp, :asterisk
  • renderers :unimrcp, :native, :native_or_unimrcp
  • grammars :voice, :dtmf

The Issue

Our defaults are a :unimrcp recognizer and a :native_or_unimrcp renderer. We use the :native_or_unimrcp renderer specifically to allow playback of audiofiles natively and TTS over unimrcp since Neospeech doesn't support audio tags.

We don't get an input type that allows us to pass along the appropriate grammar.

Our Approaches

  1. We first tried sending a voice only grammar. The switch defaults to ComposedPrompt. Upon validating the options, we get an error saying voice is not supported by default
  2. Then we tried changing the renderer to :unimrcp. This succeeds but only without audio tags.
  3. Finally, we added to the switch here to allow :native_or_unimrcp to create an MRCPPrompt, and added to the validator to have the renderer accepted. However, it's not a great solution and we'd still miss the fallback functionality.

TL;DR

The easiest thing for us to do is to simply use a :unimrcp renderer; yet the rub of the issue is that the fix for TTS fallback does not work with ASR since the fix only applies to ComposedPrompt and not also MRCPPrompt.

What do you suggest? We need both the fallback and ASR.

@Jared-Prime
Copy link
Contributor Author

cc @sfgeorge @runningferret

@benlangfeld
Copy link
Member

So, the most obvious thing (renderer = :native_or_unimrcp, recognizer = :unimrcp, which is a fairly precise description of what you want) is about the only thing you didn't list as having tried. Any thoughts on that?

The reason your first option didn't work is because input defaults to the native recognizer, which only handles DTMF. You have to specify that you want to use a recognizer via UniMRCP if you want ASR.

@Jared-Prime
Copy link
Contributor Author

@Jared-Prime
Copy link
Contributor Author

^ edited to point to correct line

@benlangfeld
Copy link
Member

So the solution here is to add :native_or_unimrcp as a clause in the inner case statement here to create a ComposedPrompt, similar to your previous PR. I'd be happy to accept a pull request to that effect, while I wasn't happy to make an alias to get to MRCPPrompt, which doesn't provide what you need.

Apologies for this being a round-about review, but it's not been clear up until this explanation what the problem was, and thus the solution was quite confused.

@Jared-Prime
Copy link
Contributor Author

does a ComposedPrompt give us ASR?

@benlangfeld
Copy link
Member

You know, it doesn't... I could have sworn it was implemented as a composition of entirely separate Input and Output components, but it's actually an Input component (DTMF only) with a nested Output.

Thinking it through further, though, UniMRCP doesn't emit a barge event over AMI, making it impossible to construct a prompt component in this way anyway. This is going to require changes to UniMRCP also :(

@Jared-Prime
Copy link
Contributor Author

Barge events do work with UniMRCP. I think just MRCPPrompt needs to be updated to incorporate the same behavior behind :native_or_unimrcp. I wonder what the cleanest approach is, without having to duplicate code between ComposedPrompt and MRCPPrompt

@benlangfeld
Copy link
Member

I know that barge events work, but UniMRCP does not propagate these as AMI events such that we can use them. MRCPPrompt leaves the TTS engine to do all rendering via UniMRCP's SynthAndRecog, and links barge internally. It cannot be adapted to your fallback requirements outside of Asterisk (eg by Punchblock). MRCPNativePrompt is the same, except rendering is done by Asterisk from a list of filenames.

You can forget all varieties of MRCPPrompt if you want your TTS optimisation, unless you want to go and re-implement that in Asterisk C code (which would be a great contribution if it was done flexibly enough, rather than just an MVP for your use).

@Jared-Prime
Copy link
Contributor Author

Ah, I see what you mean. Ideally we'd have a handler registered on RECOG
much like we have on DTMF.

We'll give this some thought and let you know what we come up with in
regards to Punchblock. In the meantime, have a nice weekend!

@bklang
Copy link
Member

bklang commented Oct 23, 2014

@Jared-Prime Any further thoughts on this? Has the situation with UniMRCP changed at all?

@Jared-Prime
Copy link
Contributor Author

Yes, I believe Asren's additions to UniMRCP SynthAndRecog should help
with this. In my opinion, we can probably close the issue.

/cc @sfgeorge

@sfgeorge
Copy link
Member

I agree with @Jared-Prime here, I believe that UniMRCP's SynthAndRecog newly integrated support for multiple TTS and/or audio prompts reduces the need for detailed AMI events during prompt progression.

One caveat: To rely on audio support in SynthAndRecog(), it is necessary for Adhearsion-Asterisk users to check that their audio files exist on-disk before passing them over to UniMRCP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants