" Module: DECTALK.ST Author: A. Grant Date: 31-Jan-1991 Version: 1.00-00 Modified: 31-Jan-1991 This module provides the basic SmallTalk class for using a DECTALK DTK1. " " | Change Log | ============================================================================ | Author Date Change " VMSTerminal subclass: #DECtalk instanceVariableNames: 'dialCommand' classVariableNames: 'esc escTerm' poolDictionaries: '' category: 'Voice'. ! !DECtalk class methodsFor: 'creation'! new: aString "Create a new instance of a DECtalk connected to port aString" | newVoice | newVoice := super new. newVoice open: aString bufSize: 48. newVoice initialise. newVoice write: '[:np]Small Talk Voice one point zero is running.'. ^newVoice ! classInit esc := Character value: 27. escTerm := ' \'. escTerm at: 1 put: esc !! !DECtalk methodsFor: 'talking'! say: aString self write: aString !! !DECtalk methodsFor: 'setting up'! initialise dialCommand := 'P0;60;40z' ! status self put: esc. self write: 'P0;60;0z'. self write: escTerm. ! dict: name pronounce: subst self put: esc. self write: 'P0;40z'. self write: name. self put: 32. self write: subst. self write: escTerm ! mode: anInteger " Set the DECtalk Mode. 1 = Sqaure On. Interpret characters within [] as phonemic text strings. )word indicate alternate pronounciation. 2 = Asky on. Interpret text in single character asky. 4 = Minus on. Pronounce the hyphen (-) as minus instead of dash. " self put: esc. self write: 'P0;80;'. self write: (anInteger printString). self write: 'z'. self write: escTerm. ! photext: aString "Say aString phonemically (is this a real word??)" self put: esc. self write: 'P0;0z'. self write: aString. self write: escTerm. ! response ^self read ! stop "Immediately stop speech" self put: esc. self write: 'P0;10z'. self write: escTerm ! sync "Complete speaking before executing any following commands" self put: esc. self write: 'P0;11z'. self write: escTerm !! !DECtalk methodsFor: 'Telephones'! setDial: aSymbol "Set the dial type to touch-tone or pulse. aSymbol must be one of #tone or #pulse" (aSymbol = #tone) ifTrue: [dialCommand := 'P0;60;40z']. (aSymbol = #pule) ifTrue: [dialCommand := 'P0;60;41z'] ! dial: aString "Dial the phone number aString." self put: esc. self write: dialCommand. self write: aString. self write: escTerm. ! hangup self put: esc. self write: 'P0;60;11z'. self write: escTerm ! enableKeypad self put: esc. self write: 'P0;60;20z'. self write: escTerm. ! disableKeypad self put: esc. self write: 'P0;60;20z'. self write: escTerm. ! phoneStatus self put: esc. self write: 'P0;60;0z'. self write: escTerm. ! autoAnswer self put: esc. self write: 'P0;60;10z'. self write: escTerm. !! | tmp | DECtalk classInit !