/* * Send text to speech server. May be used in script files. * $Id: say.c 1.2 Mon, 24 Mar 1997 12:25:37 -0500 dyfet $ * Copyright (c) 1997 by Tycho Softworks. * For conditions on distribution and reuse see product license. */ #include #include #include void main(int argc, char **argv) { STREAM fp; int port = getservice("speak"); char buf[128]; if(argc != 3) fatal(EX_USAGE, "use: say host \"message\"\n"); if(!port) fatal(EX_UNAVAILABLE, "say: speak: service not in /etc/services\n"); fp = opentcp(argv[1], port); if(!fp) fatal(EX_UNAVAILABLE, "say: %s: speak service unavailable\n", argv[1]); gettcp(buf, 127, fp); puttcp(argv[2], fp); puttcp("\n", fp); closetcp(fp); }