;; file: $isip/util/demo/isip_comm_control_server/start_servers.pgm
;; version: $Id: speech_analysis_client.pgm 10116 2005-05-20 20:47:03Z elliott $
;; NOTICE
;;  
;; This software was produced for the U.S. Government
;; under Contract No. DAAB07-97-C-E601, and is
;; subject to the Rights in Technical Data and Computer
;; Software Clause 252.227-7013 (Oct 88) and Alternate II (APR 93).
;; 
;; Copyright 1998, 1999 The MITRE Corporation

;; -------------------------------------------------
;;   LOGFILE INSTRUCTIONS
;; -------------------------------------------------

LOG_DIR: /cavs/hse/data2/isip/data/corpora/demo
LOG_VERSION: "cavs_demo 1.0"
USER_ID: spk
TIMESTAMP: recognize_speech

SERVER: data_recorder
HOST: localhost
PORT: DATA_RECORDER_PORT
OPERATIONS: reinitialize receive_signal

SERVER: signal_detector
HOST: localhost
PORT: SIGNAL_DETECTOR_PORT
OPERATIONS: reinitialize receive_signal


;; -------------------------------------------------
;;   SERVERS
;; -------------------------------------------------

SERVER: speech_analysis
HOST: CLIENT_IPADDRESS
PORT: CLIENT_PORTNUMBER
OPERATIONS: reinitialize receive_signal end_points

;;SERVICE_TYPE: speech_analysis
;;HOST: CLIENT_IPADDRESS
;;CLIENT_PORT: 15000
;;OPERATIONS: reinitialize receive_signal end_points

SERVER: Builtin
OPERATIONS: dispatch_to_main abort_main increment_utterance nop new_session end_session

;; -------------------------------------------------
;;   PROGRAM: main 
;; -------------------------------------------------
INITIAL_TOKEN: {c main :call_answered 1 }
MODE: singlethread
PROGRAM: main

RULE: :raw_data_endpointed --> data_recorder.receive_signal
IN: :raw_data_endpointed :sample_rate :frame_index :source_name :channel0 :channel1
OUT: 

RULE: :raw_data --> signal_detector.receive_signal
IN: :raw_data :sample_rate :frame_index :source_name :channel0 :channel1
OUT: 

RULE: :call_answered --> Builtin.new_session
IN:  :call_answered :server_id
LOG_IN: :call_answered
SET: :new_dialogue 1
OUT:

;; RULE: :process_id --> data_recorder.receive_signal
;; IN: :process_id :source_name
;; OUT:

;; RULE: :process_id --> signal_detector.receive_signal
;; IN: :process_id :source_name
;; OUT:

RULE: :utterance_status --> signal_detector.receive_signal
IN: :utterance_status :source_name
OUT:

RULE: :utterance_status --> data_recorder.receive_signal
IN: :utterance_status :source_name
OUT:


RULE: :new_dialogue --> builtin.increment_utterance
IN: 
SET: increment_utterance_id 1
OUT:
STORE: :utterance_id

RULE: :audio_ready --> data_recorder.receive_signal
RETRIEVE: (:utterance_id 0)
IN: :utterance_id :client_name :audio_ready :source_name :button_press_counter :hub_logdir :synth_logdir :hub_log_prefix :sample_rate :num_channels :sample_bytes :file_format
OUT:

RULE: :audio_ready --> signal_detector.receive_signal
RETRIEVE: (:utterance_id 0)
IN: :utterance_id :client_name :audio_ready :source_name :button_press_counter :hub_logdir :synth_logdir :hub_log_prefix :sample_rate :num_channels :sample_bytes :channel_d :frame_duration_d :window_duration_d :nominal_signal_d :signal_adaptation_delta_d :signal_adaptation_constant_d :nominal_noise_d :noise_adaptation_delta_d :noise_adaptation_constant_d :noise_floor_d :utterance_delta_d :min_utt_dur_d :min_utt_sep_d :max_utt_dur_d  :zc_utt_thresh_d :preemph_coef_d :pad_time_d
OUT: 

RULE: :speech_analysis_ack --> speech_analysis.receive_signal
IN: :speech_analysis_ack :source_name :button_press_counter :frame_index :filename
OUT: 

RULE: :start_recording_signal --> speech_analysis.receive_signal
IN: :start_time :stop_time
OUT: 

RULE: :start_time --> speech_analysis.end_points
IN: :start_time :stop_time
OUT: 

RULE: :data_recorder_ack --> data_recorder.receive_signal
IN: :data_recorder_ack :source_name :button_press_counter
OUT: 

;; RULE: :pid --> speech_analysis.receive_signal
;; IN: :server_name :pid
;; OUT: none!

RULE: :reset --> signal_detector.receive_signal
IN: :reset
OUT: none!

RULE: :reset --> data_recorder.receive_signal
IN: :reset
OUT: none!

;; -------------------------------------------------
;;   PROGRAM: audio
;; -------------------------------------------------

