새로운 VPS 서버로 블로그도 옮겼다.
데이터 동기화 완료! 포스팅 동기화도 완료!
새로운 VPS 서버로 블로그도 옮겼다.
데이터 동기화 완료! 포스팅 동기화도 완료!
알고리즘 관련한 좋은 책 포스팅..
C로 배우는 알고리즘 1,2 (이재규)(세화)
http://www.yes24.com/24/goods/18003
알고리즘이 보이는 그림책 (일본)(성안당)
http://www.yes24.com/24/goods/2716581
열혈강의 자료구조 (이상진)(프리렉)
http://www.yes24.com/24/goods/3670039
뇌를 자극하는 알고리즘 (박상현)(한빛미디어)
http://www.yes24.com/24/goods/3524901
C로 구현한 알고리즘 (Kyle Loudon)(오라일리)(한빛미디어)
http://www.yes24.com/24/goods/119652
Programming Challenges (알고리즘 트레이닝 북)(한빛미디어)
http://www.yes24.com/24/goods/1396784
수준있는 알고리즘 책으로…
Introduction to Algorithms (Thomas H. Cormen)(MIT press)(한빛미디어)
http://www.yes24.com/24/goods/1488338
The Art of Computer Programming (도널드 커누스)(한빛미디어)
http://www.yes24.com/24/goods/2149593
원본 : https://kldp.org/node/122538
Redis 서버를 레플리카 셋 구성 설정 명령어 후, OK 메시지를 받는 것과 실제 Master 서버와 Sync 를 맞추는 것과는 다른 문제다.
즉, 서버 설정에는 성공했어도, Master 서버와의 Sync 에는 실패할 수도 있다는 이야기다.
레플리카 설정 후에는 SYNC 혹은 INFO 명령으로 반드시 SYNC 를 확인하도록 하자.
Freeswitch 에서 TTS 서비스를 제공하는 방법은 크게 두가지가 있다.
1. Dialplan 에서 해당 모듈을 직접 호출하는 방법.
2. Python, Lua 와 같은 스크립트 모듈에서 호출하는 방법
여기에서는 Python 스크립트 모듈에서 사용하는 방법을 기술한다.
mod_tts_commandline 을 사용하는 방법
Freeswitch 에서는 TTS 서비스를 위해 여러가지 모듈들을 제공하는데, 그 중 mod_tts_commandline 모듈은 서버에 설치되어 있는 TTS 프로그램과 연동하여 TTS 서비스를 제공하는 모듈이다 .
먼저 mod_tts_commandline 모듈을 설치하자.
cd /freeswitch/souce/directory
vi 편집기로 modules.conf 파일에서 asr_tts/mod_tts_commandline 부분을 주석 해제하자.
./configure && make && make install
설치가 끝나면, 해당 모듈이 자동 로드될 수 있도록 해주자.
vi /freeswitch/config_directory/conf/autoload_configs/modules.conf.xml
<load module=”mod_tts_commandline”/> 부분을 주석해제해주자.
tts_commandline.conf.xml 파일을 수정해야 한다. 여러가지 명령어 구문들이 가능한데.. 다음은 epseak 를 사용한 예제 명령어 구문이다.
<param name=”command” value=”echo ${text} | espeak –stdin –stdout -v default| sox -t wav – -r ${rate} ${file}”/>
기타 다른 예시 명령어 문구는 https://wiki.freeswitch.org/wiki/Mod_tts_commandline 에서 확인할 수 있다.
이후 Python 스크립트에서 다음과 같이 호출하여 사용하면 된다.
session.set_tts_params("espeak", "default");
session.speak("Hello, world!");
mod_shout 를 사용하는 방법
본래, mod_shout 는 외부 자원을 재생시키는 모듈이다. 하지만 이를 이용하면 외부(웹)에서 제공하는 TTS 서비스를 사용할 수 있다.
외부(웹)에서 TTS 를 제공하는 곳은 크게, Bing/Google 이 있는데, 여기서는 Google 을 기준으로 설명한다.
간단하다. mod_shout 설치 후, 다음과 같이 사용하면 된다.
session.streamFile("shout://translate.google.com/translate_tts?tl=en&q=Hello+world", "")
# 혹은...
recvDtmf=session.playAndGetDigits(1, 1, 1, 1, "", "shout://translate.google.com/translate_tts?tl=en&q=Hello+world", "", "", "", 0, "")
참조:
https://wiki.freeswitch.org/wiki/Mod_shout
https://wiki.freeswitch.org/wiki/Session_streamFile
https://wiki.freeswitch.org/wiki/Playing_recording_external_media
https://wiki.freeswitch.org/wiki/Mod_tts_commandline