#!/bin/sh

export RTCSH_CWD=/localhost:5005/
export RTCTREE_NAMESERVERS="localhost:5005"

RH_VOICE_BIN_DIR=/opt/rh/RS003/bin/comp
RH_VOICE_CONF_DIR=/opt/rh/RS003/etc/conf

cd $RH_VOICE_CONF_DIR
#pulseaudiooutput &
$RH_VOICE_BIN_DIR/pulseaudiooutput -f ./pulseaudiooutput.conf &
openjtalkrtc -f ./openjtalkrtc.conf &
sleep 3
rtcat OpenJTalkRTC0.rtc
rtcat PulseAudioOutput0.rtc
rtcon OpenJTalkRTC0.rtc:result PulseAudioOutput0.rtc:SampleInPort0
rtact PulseAudioOutput0.rtc
echo "pulseaudiooutput activate"
rtact OpenJTalkRTC0.rtc
echo "openjtalkrtc activate"
sleep 3
rtinject OpenJTalkRTC0.rtc:text 'RTC.TimedString({time},"音声が起動しました。")'
