Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

170.19. 中文语音包

https://files.freeswitch.org/releases/sounds/
		
[   ]	freeswitch-sounds-zh-cn-sinmei-8000-1.0.51.tar.gz	2014-10-09 20:21	296K	 
[   ]	freeswitch-sounds-zh-cn-sinmei-8000-1.0.51.tar.gz.md5	2014-10-09 20:21	92	 
[   ]	freeswitch-sounds-zh-cn-sinmei-8000-1.0.51.tar.gz.sha1	2014-10-09 20:21	101	 
[   ]	freeswitch-sounds-zh-cn-sinmei-8000-1.0.51.tar.gz.sha256	2014-10-09 20:21	127	 
[   ]	freeswitch-sounds-zh-cn-sinmei-16000-1.0.51.tar.gz	2014-10-09 20:21	583K	 
[   ]	freeswitch-sounds-zh-cn-sinmei-16000-1.0.51.tar.gz.md5	2014-10-09 20:21	93	 
[   ]	freeswitch-sounds-zh-cn-sinmei-16000-1.0.51.tar.gz.sha1	2014-10-09 20:21	102	 
[   ]	freeswitch-sounds-zh-cn-sinmei-16000-1.0.51.tar.gz.sha256	2014-10-09 20:21	128	 
[   ]	freeswitch-sounds-zh-cn-sinmei-32000-1.0.51.tar.gz	2014-10-09 20:21	1.1M	 
[   ]	freeswitch-sounds-zh-cn-sinmei-32000-1.0.51.tar.gz.md5	2014-10-09 20:21	93	 
[   ]	freeswitch-sounds-zh-cn-sinmei-32000-1.0.51.tar.gz.sha1	2014-10-09 20:21	102	 
[   ]	freeswitch-sounds-zh-cn-sinmei-32000-1.0.51.tar.gz.sha256	2014-10-09 20:21	128	 
[   ]	freeswitch-sounds-zh-cn-sinmei-48000-1.0.51.tar.gz	2014-10-09 20:21	1.6M	 
[   ]	freeswitch-sounds-zh-cn-sinmei-48000-1.0.51.tar.gz.md5	2014-10-09 20:21	93	 
[   ]	freeswitch-sounds-zh-cn-sinmei-48000-1.0.51.tar.gz.sha1	2014-10-09 20:21	102	 
[   ]	freeswitch-sounds-zh-cn-sinmei-48000-1.0.51.tar.gz.sha256	2014-10-09 20:21	128	 
		
		

编译 mod_say_zh 模块

		
cd /usr/local/src/freeswitch/src/mod/say/mod_say_zh
 
make && make install		
		
		

autoload_configs/modules.conf.xml

		
    <!-- Say -->
    <load module="mod_say_en"/>
 
    <load module="mod_say_zh"/>
		
		
		

		
cd /usr/local/freeswitch/conf/lang/
cp -fr en zh
cd zh
mv en.xml zh.xml
		
		
		

zh.xml

		
<language name="zh" say-module="zh" sound-prefix="$${sounds_dir}/zh/cn/link" tts-engine="mod_tts_commandline" tts-voice="link">		
		
		

vars.xml

		
  <X-PRE-PROCESS cmd="set" data="sound_prefix=$${sounds_dir}/zh/cn/link"/>
  <X-PRE-PROCESS cmd="set" data="default_language=zh"/>
  <X-PRE-PROCESS cmd="set" data="default_dialect=cn"/>
  <X-PRE-PROCESS cmd="set" data="default_voice=link"/>		
		
		

freeswitch.xml

		
<X-PRE-PROCESS cmd="include" data="lang/zh/*.xml"/>		
		
		

fs_cli 手动加载模块

		 
load mod_say_zh
reloadxml
		
		
		

配置 Dialplan 拨号计划 dialplan/default.xml

		
    <!--say测试-->
	<extension name="socket_767_example">
		<condition field="destination_number" expression="^767\d+$">
		    <action application="answer"/>
			<action application="say" data="zh name_spelled intered 3456789"></action>
            <action application="say" data="en NUMBER intered 3456789"></action>
            <action application="say" data="zh TELEPHONE_NUMBER intered 13781655437"></action>
            <action application="playback" data="voicemail/vm-goodbye.wav"></action>
		</condition>
	</extension>
		
		

单个用户配置 1001.xml

		
<variable name="language" value="zh"/>
<variable name="default_language" value="zh"/>		
		
		

dialplan中配置中文

		
	<extension name="ivr_demo">
      <condition field="destination_number" expression="^5000$">
        <action application="set" data="language=zh"/>
        <action application="answer"/>
        <action application="sleep" data="2000"/>
        <action application="ivr" data="demo_ivr"/>
      </condition>
    </extension>