#!/usr/bin/php
<?php
$buf = 128;
$res = proc_open('/usr/bin/pacat -p --raw --rate=11025 --channels=1 --latency-msec=100 --process-time-msec=100',array(0 => array('pipe','r')),$pp);
$fp = fopen('/tmp/noaawx_eas_play_pid.txt','w');
fwrite($fp,proc_get_status($res)['pid']);
fclose($fp);
$stdin = fopen('php://stdin', 'r');
while (is_resource($res)) {
	while (!feof($stdin)) {
		$dat = fread($stdin,$buf);
		fwrite($pp[0],$dat,strlen($dat));
	}
	sleep(1);
}

