SOLVED 'say' in Spanish not working

Status
Not open for further replies.

ewdpb

Member
Oct 3, 2019
151
19
18
Hi all,

I am trying to simply have say reading back input digits in Spanish to a single domain (I do not want to change the defaults).

Based on the documentation, I am simply doing:

Code:
caller_input = 785412
session:execute('say', 'es number iterated '..caller_input)

However I keep getting a "Can't find language es" error

error.png

As far as I can see Spanish module is enabled and running:

spanish1.png
spanish2.png

I can also see all audio files in the correct location:

spanish3.png

I tried with French and it works well. Is there anything I may be missing in the configuration?

Thanks!
 

ewdpb

Member
Oct 3, 2019
151
19
18
Hi all,

I made some progress here:

I found out that the languages section in /etc/freeswitch/freeswitch.xml was missing a reference to Spanish. So I added it:

XML:
  <!-- languages section -->
<section name="languages" description="Language Management">
    <X-PRE-PROCESS cmd="include" data="languages/es/*.xml"/>
  </section>
</document>

Now, I am not getting the original "Can't find language es" error. However, my system is looking for the digits in a very interesting location:

Code:
Error Opening File [/usr/share/freeswitch/sounds/es/cl/callie/digits/4.wav] [System error : No such file or directory.]

Note that in the error the path includes '.../es/cl/callie/digits...' I have no clue where that cl is coming from. I understand that is probably the dialect but I've no idea where I could have defined a cl dialect for Spanish or where can it be defined.

The error itself is fair because that path is not valid. However, I am trying to figure out where the system gets that path from. By default the sound_prefix variable is defined as:

$${sounds_dir}/en/us/callie

I modified sound_prefix to reflect the actual location of the audio files:

$${sounds_dir}/es/ar/mario

But it does not seem to do much. I restarted freeswitch just in case.

I even tried forcing the path inside the LUA script:

Code:
-- Read back input number to the caller
session:execute('set', 'sound_prefix=$${sounds_dir}/es/ar/mario');
session:execute('say', 'es number iterated '..caller_input)

But it also does not make any difference. I still get the same error with the system looking for the digits in the same odd location.

My /usr/share/freeswitch/lang/es/es.xml looks like this:

XML:
<include>
  <language name="es" say-module="es" sound-path="$${sounds_dir}/es/ar/mario" tts-engine="cepstral" tts-voice="marta">
    <phrases>
      <macros>
        <X-PRE-PROCESS cmd="include" data="demo/*-es.xml"/> <!-- Note: this now grabs whole subdir, previously grabbed only demo.xml -->
        <!--voicemail_es_MX_tts is purely implemented with tts, we have the files based one that is the default. -->
        <X-PRE-PROCESS cmd="include" data="vm/sounds-es.xml"/>  <!-- vm/tts.xml if you want to use tts and have cepstral -->
        <X-PRE-PROCESS cmd="include" data="dir/sounds-es.xml"/>  <!-- dir/tts.xml if you want to use tts and have cepstral -->
      </macros>
    </phrases>
  </language>
</include>

I appreciate any hint on what else I would need to look into.

Thanks!
 
Last edited:

ewdpb

Member
Oct 3, 2019
151
19
18
Well, as usual while typing out all this I actually found the problem. I was editiig the wrong file. I was editing /usr/share/freeswitch/lang/es/es.xml but I (also?) had to edit /etc/freeswitch/languages/es/es.xml.

XML:
<include>
        <language name="es" say-module="es" sound-prefix="$${sounds_dir}/es/ar/mario" tts-engine="cepstral" tts-voice="mario">
                <phrases>
                        <macros>
                                <X-PRE-PROCESS cmd="include" data="demo/*.xml"/> <!-- Note: this now grabs whole subdir, previously grabbed only demo.xml -->
                                <!--voicemail_en_tts is purely implemented with tts, we have the files based one that is the default. -->
                                <X-PRE-PROCESS cmd="include" data="vm/sounds.xml"/>  <!-- vm/tts.xml if you want to use tts and have cepstral -->
                                <X-PRE-PROCESS cmd="include" data="dir/sounds.xml"/>  <!-- dir/tts.xml if you want to use tts and have cepstral -->
                                <X-PRE-PROCESS cmd="include" data="ivr/*.xml"/>  <!-- IVR and custom phrases go here -->
                                <X-PRE-PROCESS cmd="include" data="vm/voicemail_ivr.xml"/>
                        </macros>
                </phrases>
        </language>
</include>

So, hopefully this thread serves as a reference to somebody else. I would like to add (suggest) this to FusionPBX code base but I am not familiar with github collaboration, I have to figure that out first.

Thanks!
 
  • Like
Reactions: DigitalDaz
Status
Not open for further replies.