'ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ '³ Nom : SPO_Lptx.bas DOS 4.01 Video : MAGIC VGA ³ '³ Date : Decembre 91 Materiel: Kenitech 386SX VGA ³ '³ Auteur : P.FREYER Langage : Turbo Basic Borland v1.5 ³ '³ But : Synthetiseur de parole SPOAL2 sur port imprimante ³ '³ Vocabulaire bas‚ sur 63 PhonŠmes anglais .!! ³ '³ ³ 'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ $Stack 4096 $COM1 128 $COM2 128 $SOUND 32 defint i,j dim month$(12),month%(12) ' libell‚ et nb de jours des mois dim JourSem$(8) ' Jours de la semaine data Lundi,Mardi,Mercredi,Jeudi,Vendredi,Samedi,Dimanche,Lundi for j=0 to 7:read JourSem$(J):next j data " ",0,"Janvier",31,"Fevrier",28,"Mars",31,"Avril",30,"Mai",31 data "Jun",30,"July",31,"Aout",31,"Septembre",30,"Octobre",31,"Novembre",30 data "Decembre",31 for j=0 to 12: read Month$(j):Read month%(j):next j call what.time dim mots$(100),ascii$(100) LPTX=&h278 screen 0 cls i=FNCombien.Entier(1,1,"Port d'imprimante ",1,2) if i=1 then LPTX=&h378 else LPTX=&h278 Debug=0 'Debug=FNCombien.Entier(2,1,"Debug : ",0,1) Cls mots$ (1)="27,07,45,15,53":ascii$ (1)="Hello": mots$ (2)="24,06": ascii$ (2) ="I": mots$ (3)="42,26": ascii$ (3) ="Can": mots$ (4)="55,55,02,19,02,41": ascii$ (4)="Speak": mots$ (5)="07,07,00,11,36,45,19,02,50":ascii$ (5) ="English": mots$ (6)="02":ascii$ (6) =",": mots$ (7)="04":ascii$ (7) =".": mots$ (8)="12,13,02":ascii$ (8) ="It": mots$ (9)="20,43":ascii$ (9) ="Is": mots$ (10)="43,60,53":ascii$ (10)="Zero": mots$ (11)="46,15,11":ascii$ (11)="One": mots$ (12)="13,31": ascii$ (12)="Two": mots$ (13)="29,14,19":ascii$ (13)="Three": mots$ (14)="44,40,58":ascii$ (14)="Four": mots$ (15)="40,40,06,35":ascii$ (15)="Five": mots$ (16)="55,55,12,12,03,41,55":ascii$ (16)="Six": mots$ (17)="55,55,07,07,35,12,12,03":ascii$ (17)="Seven": mots$ (18)="20,03,13":ascii$ (18)="Eight": mots$ (19)="11,24,06,11":ascii$ (19)="Nine": mots$ (20)="13,07,07,11":ascii$ (20)="Ten": mots$ (21)="12,45,07,07,35,12,11":ascii$ (21)="Eleven": mots$ (22)="13,48,07,07,45,35":ascii$ (22)="Twelve": mots$ (23)="29,51,01,02,13,19,11":ascii$ (23)="Thirteen": mots$ (24)="40,58,01,02,13,19,11":ascii$ (24)="Fourteen": mots$ (25)="40,12,40,01,02,13,19,11":ascii$ (25)="Fifteen": mots$ (26)="55,55,12,02,41,55,01,02,13,19,11":ascii$ (26)="Sixteen": mots$ (27)="55,55,07,35,29,11,01,02,13,19,11":ascii$ (27)="Seventeen": mots$ (28)="20,01,02,13,19,11":ascii$ (28)="Eighteen": mots$ (29)="11,06,11,01,02,13,19,11":ascii$ (29)="Nineteen": mots$ (30)="13,48,07,07,11,01,02,13,19":ascii$ (30)="Twenty": mots$ (31)="29,52,01,02,13,19":ascii$ (31)="Thirty": mots$ (32)="40,58,01,02,13,19":ascii$ (32)="Forty": mots$ (33)="40,40,12,40,40,01,02,13,19":ascii$ (33)="Fifty": mots$ (34)="55,55,12,02,41,01,02,13,19":ascii$ (34)="Sixty": mots$ (35)="55,55,07,35,12,11,01,02,13,19":ascii$ (35)="Seventy": mots$ (36)="20,02,13,19":ascii$ (36)="Eighty": mots$ (37)="11,06,11,02,13,19":ascii$ (37)="Ninety": mots$ (38)="57,15,15,11,01,33,39,12,12,00,21":ascii$ (38)="Hundred": mots$ (39)="29,24,32,43,29,00,11,21":ascii$ (39)="Thousand": mots$ (40)="16,12,12,45,49,11":ascii$ (40)="Million": mots$ (41)="56,15,53":ascii$ (41)="No": mots$ (42)="25,07,07,55,55":ascii$ (42)="Yes": mots$ (43)="09,00,39,20,55,55,04":ascii$ (43)="Press": mots$ (44)="18,08,02": ascii$ (44)="The": mots$ (45)="42,19,04": ascii$ (45)="Key": mots$ (46)="28,26,02,20,01": ascii$ (46)="Bad": mots$ (47)="25,60": ascii$ (47)="Year": mots$ (48)="33,20,02,13": ascii$ (48)="Date": mots$ (49)="33,07,20": ascii$ (49)="Day": mots$ (50)="16,15,15,11,01,33,20":ascii$ (50)="Monday": mots$ (51)="16,31,43,01,33,20":ascii$ (51)="Tuesday": mots$ (52)="46,07,07,11,43,01,33,20":ascii$ (52)="Wednesday": mots$ (53)="29,52,43,01,33,20":ascii$ (53)="Thursday": mots$ (54)="40,39,06,01,33,20":ascii$ (54)="Friday": mots$ (55)="55,55,26,02,13,01,33,20":ascii$ (55)="Saturday": mots$ (56)="55,55,15,15,11,01,33,20":ascii$ (56)="Sunday": mots$ (57)="16,15,15,11": ascii$ (57)="Month": mots$ (58)="10,26,26,11,25,47,19": ascii$ (58)="January": mots$ (59)="40,07,07,01,34,39,31,47,19": ascii$ (59)="February": mots$ (60)="16,59,02,50": ascii$ (60)="March": mots$ (61)="20,02,09,39,12,12,45": ascii$ (61)="April": mots$ (62)="16,20": ascii$ (62)="May": mots$ (63)="10,31,11": ascii$ (63)="June": mots$ (64)="10,22,45,06": ascii$ (64)="July": mots$ (65)="23,23,01,61,15,55,02,17": ascii$ (65)="August": mots$ (66)="55,55,07,02,09,02,13,07,07,00,63": ascii$ (66)="September": mots$ (67)="24,01,41,02,13,53,00,63,51": ascii$ (67)="October": mots$ (68)="56,53,35,07,07,16,00,63,51": ascii$ (68)="November": mots$ (69)="33,19,55,55,07,07,16,00,63,51": ascii$ (69)="December": mots$ (70)="42,45,24,24,02,41": ascii$ (70)="Clock": mots$ (71)="32,51": ascii$ (71)="Hour": mots$ (72)="16,12,11,12,02,13": ascii$ (72)="Minute": mots$ (73)="55,55,07,02,42,12,11,01,21": ascii$ (73)="Second": mots$ (74)="42,15,16,09,49,22,13,51": ascii$ (74)="Computer": mots$ (75)="28,59,02,16": ascii$ (75)="Alarm": mots$ (76)="50,07,07,02,41": ascii$ (76)="Check": mots$ (77)="42,52,07,07,01,41,01,17": ascii$ (77)="Correct": mots$ (78)="07,47,58": ascii$ (78)="Error": for i=1 to 78 if instat then a$=inkey$ if a$=chr$(27) then i=78 gosub Dis.un.Mot next i screen 0 cls %Fin.Phoneme=65 Dim Cp$(65) Liste.Phoneme: Data PA1,PA2,PA3,PA4,PA5 Data OY,AY,EH,KK3,PP,JH,NN1,IH,TT2,RR1,AX,MM,TT1,DH1 Data IY,EY,DD1,UW1,AO,AA,YY2,AE,HH1,BB1,TH,UH,UW2,AW Data DD2,GG3,VV,GG1,SH,ZH,RR2,FF,KK2,KK1,ZZ,NG,LL,WW Data XR,WH,YY1,CH,ER1,ER2,OW,DH2,SS,NN2,HH2,OR,AR,YR Data GG2,EL,BB2 Color 2 Restore Liste.Phoneme ?"Liste des Phonemes disponibles:" For I=0 to 63 :read Cp$(I):?using "###=\ \";I;cp$(I),:next I ? ? delay 1 locate 10,1 Color 11 'RESTORE Presentation 'FOR I=1 TO 5:GOSUB Dis.quelque.chose:NEXT I:PRINT 'RESTORE Nombres 'FOR I=1 TO 4:GOSUB Dis.quelque.chose:NEXT I:PRINT 'RESTORE Mois 'FOR I=1 TO 2:GOSUB Dis.quelque.chose:NEXT I:PRINT RESTORE Divers Gosub Dis.quelque.chose delay 2 cls call what.time print "jour= ";jour;" mois=";mois;" joursem=";joursem gosub Dis.date gosub Shutup delay 1 print print "fin normale de programme..." do loop while not instat a$=inkey$ Stop end ' Format des datas: ' - Restore pour indiquer la ligne du mot ou phrase a prononcer ' - code superieur a 80 pour indiquer le nombre de datas par ligne ' ex 89-80 => 9 datas suivent...sous le format des phonemes ' qui vont de 0.. a ... 64. voir notice SPO256 AL2 Presentation: DATA 85,27,7,45,15,53,"HELLO" DATA 82,24,6,"I" DATA 83,42,26,11,"CAN" DATA 86,55,55,2,19,2,41,"SPEAK" DATA 89,7,7,0,11,36,45,19,2,50,"ENGLISH" nombres: DATA 83,43,60,53,"Zero" DATA 83,46,15,11,"One" DATA 82,13,31,"Two" DATA 83,29,14,19,"Three" Mois: DATA 87,10,26,11,30,26,39,19,"January" DATA 87,40,7,34,39,31,39,19,"February" Divers: DATA 87,16,0,7,7,14,2,21,"MERDE" Transmission: OUT LPTX,128+A WAIT LPTX+1,64 OUT LPTX,A RETURN Shutup : A=3:GOSUB Transmission A=64:GOSUB Transmission return Dis.quelque.chose : Read K Gosub Ennonce Read NOUN$ Print NOUN$;" "; gosub Shutup Return Ennonce: FOR jjj=1 TO K-80 READ A GOSUB Transmission Next jjj Return Dis.un.Mot: color 4,0 a$=mots$(i) print i;" ";ascii$(i);" = ";a$ color 7,0 k=len(a$) if debug=1 then print ascii$(i) if k>3 then do l=instr(a$,",") b$=left$(a$,l-1) a=val(b$) k=k-l a$=right$(a$,k) gosub Transmission if debug=1 then print b$,k,l loop while k>=3 end if if debug=1 then color 3,0 ?a$ end if a=val(a$) gosub transmission gosub Shutup return Dis.Date: i=JourSem+50 :gosub Dis.un.mot i=Jour if i<=20 then i=i+10 gosub Dis.un.mot else i1%=int(i/10)-2 i2%=i mod 10 i=i1%+30: gosub Dis.un.mot i=i2%+10:if i>10 then gosub Dis.un.mot end if i=mois+57:if mois<13 and mois>0 then gosub Dis.un.mot i=29:gosub Dis.un.mot i=38:gosub Dis.un.mot i=37:gosub Dis.un.mot i=11:gosub Dis.un.mot return OUestle.Curseur : Lig = CSRLIN Col = POS(0) Return Def FNCOMBIEN.Entier (lign,Col,A$,mini,maxi) local o,j,k$,i$,f$,b$,k,signe,tt0!,x,y,Mi$,Ma$ comb1: Mi$=str$(mini) Ma$=str$(maxi) Mi$=string$(len(Mi$),"#") Ma$=string$(len(Ma$),"#") delay 1 f$="\"+space$(len(A$))+"\"+" de <"+Mi$+"> … <"+ma$+"> " locate lign,col ?using f$;a$;mini;maxi; k$="" tt0!=timer x=pos(o):y=csrlin ?" "; locate y,x i$="" do b$=inkey$ if b$<>"" then if asc(b$)=13 then exit Loop else ?b$; i$=i$+b$ end if End if loop until len(i$)>5 if i$="" then i=mini+(maxi-mini)\2 ?using"#####";i; else signe=1 if left$(i$,1)="-" then signe=-1 i$=right$(i$,len(i$)-1) end if j=1 do k$=mid$(i$,j,1) k=asc(k$) select case k case 48 to 57 incr J case else goto Comb1 end select Loop until j>=len(i$) or timer>tt0!+60 i=val(i$)*signe if (imaxi) then beep goto comb1 end if end if FnCombien.entier = I End def 'data Samedi,Dimanche,Lundi,Mardi,Mercredi,Jeudi,Vendredi,Samedi 'for j=1 to 8:read JourSem$(J):next j DEF FNJourDate$ (Jdate) Local i,j,k,L L=annee if Jdate>Numjour then decr L IF Jdate <1 or Jdate > 365-(l mod 4=0) then a$="erreur/jour" beep ELSE Month%(2)=28-(L mod 4=0) i=0 :k=0 do incr i k=k+month%(i) if k >=Jdate then j=Jdate-k+month%(i) exit Loop end if loop until i>11 a$=str$(j) a$=right$(a$,len(a$)-1) if len(a$)<2 then a$="0"+a$ a$=a$+" "+left$(month$(i),4)+" "+right$(str$(L),2) END if FNJourDate$=A$ Month%(2)=28-(Annee mod 4=0) End DEF Sub What.time ' retourne le jour et l'heure en haut a droite de l'ecran local b$ shared numjour,THeur,TMin,Tsec,jour,mois,annee,month%(),month$(),joursem$(),joursem out &h70,4:Theur=inp(&h71) out &h70,2:Tmin=inp(&h71) out &h70,0:Tsec=inp(&h71) out &h70,6:JourSem=inp(&h71) out &h70,7:Jour=inp(&h71) out &h70,8:Mois=inp(&h71) out &h70,9:Annee=inp(&h71) if Annee<>255 and Mois<>255 and jour<>255 then ' No ERROR Jour=val(hex$(Jour)) Mois=val(hex$(Mois)) annee=val(hex$(Annee)) call JourCalendaire locate 1,40 Print using"\ \ ## \ \ ## \\:\\:\\ Nj=###";_ joursem$(joursem);Jour;Month$(Mois);Annee;hex$(Theur);_ hex$(Tmin);hex$(Tsec);numjour; end if End sub DEF FNFrenchDate$ (A$) local j% mois$=left$(a$,2):mois=val(mois$) Jour$=Mid$(a$,4,2):jour=val(jour$) Annee$=Right$(A$,2):Annee=Val(Annee$) FNfrenchdate$=Jour$+"/"+mois$+"/"+Annee$ Call JourCalendaire End DEF SUB JourCalendaire local j% shared numjour,Jour,Mois,annee,month%() if annee mod 4=0 then month%(2)=29 else month%(2)=28 end if j%=0 Numjour=0 For j%=1 to mois-1 Numjour=Numjour+month%(j%) Next j% Numjour=Numjour+Jour end Sub