Plan 9 from Bell Labs’s /usr/web/sources/contrib/nemo/octopus/Plan9/mvoice.b

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


# machine dependent voice support
#
implement Mvoice;
include "sys.m";
	sys: Sys;
	Dir, pctl, NEWPGRP, DMDIR, open, OREAD, FD, OWRITE, ORCLOSE, FORKFD,
	ORDWR, FORKNS, NEWFD, MREPL, MBEFORE, MAFTER, MCREATE, pipe, mount,
	fprint, sprint, create, pwrite, read, QTDIR, QTFILE, fildes, Qid: import sys;
include "mvoice.m";

Dev : con "/term/fs/devs/voice/output";

init() : string
{
	sys = load Sys Sys->PATH;
	fd := open(Dev, OWRITE);
	if (fd == nil)
		return sprint("%s: %r", Dev);
	return nil;
}

speak(text: string): string
{
	fd := open(Dev, OWRITE);
	if (fd == nil)
		return sprint("voice: %r");
	if (fprint(fd, "%s\n", text)  < 0)
		return sprint("voice: %r");
	return nil;
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.