0
votes

I’m using a publically available AGI Script that wraps Google’s Speech Recognition API for converting speech to text in Asterisk. Basically, the script passes an audio file do Google and returns the text recognized from the audio.

This is working great, except for one deal breaking problem. Whenever the recognized text contains extended characters such as “á”, “ã”, “é”, etc., the dial plan gets a distorted string. For example, Google returns the text “não”, but ASTERISK gets “não”.

This, obviously, is related to the encoding… But I’m having trouble, due to limited knowledge in AGI and PEARL, determining where the problem. As far as I could determine, it could be

GOOGLE -> PEARL or PEARL -> ASTERISK

I hope someone can help me on this…

1
A single letter with accent showing up as à + another non-ASCII character is a usually caused by interpreting multi-byte UTF-8 as single-byte ISO 8859-x.MSalters

1 Answers

0
votes

Got it!

Used a function called "decode" to decode the response from the Google API.