home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Club Elmshorn Atari PD
/
CCE_PD.iso
/
pc
/
0600
/
CCE_0606.ZIP
/
CCE_0606.PD
/
SPEAK
/
SPEAK.LST
< prev
next >
Wrap
File List
|
1989-12-16
|
5KB
|
212 lines
' ************************************
' * *
' * SPRACHAUSGABE MIT ST-SPEECH *
' * *
' * 1989 MARTIN MALICH *
' * ECKHARD GRAH *
' * (c) MAXON Computer GmbH *
' * *
' ************************************
'
Gosub Init_say
Gosub Say(" 5 4 3 2 1 Hello, I am SAM. the digital voice for the ATARI S T.")
Gosub Say("exclusiv from MAXON Computer.")
Gosub Say("The best ATARI S T Public Domain Service.")
Gosub Exit_say
End
'
' Einfacher geht's nicht !!!!
'
Procedure Init_say
Local Relo_table%,Relo_end%,Relo_adr%,Say_start%,R%,A%
'
Dim Say!(40000*8) ! Platz für speaktex.tos
Dim Puffer!(1000*8) ! Sprachpuffer
'
Puffer%=Lpeek(Arrptr(Puffer!()))+500
Say%=Varptr(Say!(0))
'
If Exist("speaktex.tos")
Bload "speaktex.tos",Say%
Else
Alert 3,"SPEAKTEX.TOS nicht vorhanden",1," Abbruch ",Dummy%
End
Endif
'
Relo_table%=Say%+28256
Relo_end%=Say%+28359
Relo_adr%=Say%+80
Say_start%=Say%+28
'
For R%=Relo_table% To Relo_end%
A%=Peek(R%)
If A%=1
Add Relo_adr%,254
Else
Add Relo_adr%,A%
Lpoke Relo_adr%,Lpeek(Relo_adr%)+Say_start%
Endif
Next R%
'
Add Say%,&H52
'
Return
'
'
Procedure Exit_say
'
@Wait_say
Erase Say!()
Erase Puffer!()
'
Return
'
'
Procedure Say(A$)
'
If Len(A$)>0
Bmove Varptr(A$),Puffer%,Len(A$)+1
Void C:Say%(L:Puffer%,Len(A$))
Endif
'
Return
'
'
Procedure Wait_say
Local Er%
'
Clr Er%
Repeat
If Peek(&HFFFA0B)=32
Inc Er%
Else
Clr Er%
Endif
Until Er%=50
Spoke &HFFFA19,0
'
Return
'
'
Procedure Say_number(Num%)
Local Num1%,Num1$,I%,Num$
'
If Num%<0
@Say("minus")
Num%=-Num%
Endif
'
If Num%=0
@Say("0")
Else
Num$=Str$(Num%)
For I%=Int(Len(Num$)/3)*3 To 0 Step -3
'
If Num%>9
Num1%=Int(Num%/10^I%)
Else
Num1%=Num%
Endif
'
Num1$=Str$(Num1%)
If Num1%>0
If Num1%>=100
'
@Say(Left$(Num1$,1))
@Say("hundred")
Num1$=Right$(Num1$,2)
Num1%=Val(Num1$)
If Left$(Num1$,1)="0" And Left$(Num1$,2)<>"00"
@Say("and")
Endif
'
Endif
If Num1%>=20
A$=Left$(Num1$,1)
If A$="2"
@Say("twenty")
Else
If A$="3"
@Say("thirty")
Else
If A$="4"
@Say("fourty")
Else
If A$="5"
@Say("fifty")
Else
If A$="6"
@Say("sixty")
Else
If A$="7"
@Say("seventy")
Else
If A$="8"
@Say("eighty")
Else
If A$="9"
@Say("nine te")
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Num1$=Right$(Num1$,1)
Num1%=Val(Num1$)
If Num1%<>0
@Say(Num1$)
Endif
Else
If Num1%<=9 And Num1%>0
@Say(Str$(Num1%))
Else
If Num1%=10
@Say("ten")
Else
If Num1%=11
@Say("eleven")
Else
If Num1%=12
@Say("twelve")
Else
If Num1%=13
@Say("thirteen")
Else
If Num1%=14
@Say("4teen")
Else
If Num1%=15
@Say("fifteen")
Else
If Num1%>=16
@Say(Right$(Num1$,1)+"teen")
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
If I%=9
@Say("billion")
Else
If I%=6
@Say("million")
Else
If I%=3
@Say("thousand")
Endif
Endif
Endif
Num%=Num%-Int(Num%/10^I%)*10^I%
Endif
Next I%
Endif
'
Return