Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.title "音声メモ帳"
- cls
- !print "音声メモ帳です。\n録音ボタンを押せば録音します。\n読み上げボタンをおせば読み上げします。"
- !console.save "stttts.txt"
- grabfile hokan$,"stttts.txt",1
- grabfile outhtml$,"stttts1.htm",1
- allstart:
- console.title "音声メモ帳"
- outhtmlx$=replace$(outhtml$,"@@@1@@@",hokan$)
- nxttest:
- HTML.OPEN
- HTML.LOAD.string outhtmlx$
- xnextUserAction:
- ! loop until data$ is not ""
- DO
- HTML.GET.DATALINK data$
- UNTIL data$ <> ""
- type$ = LEFT$(data$, 4)
- data$ = MID$(data$,5)
- ! Act on the data type
- ! Shown are all the current data types
- SW.BEGIN type$
- ! Back Key hit.
- ! if we can go back then do it
- SW.CASE "BAK:"
- PRINT "BACK key: " + data$
- popup "終了します",0,0,0
- pause 2000
- end
- SW.BREAK
- ! A hyperlink was clicked on
- SW.CASE "LNK:"
- PRINT "Hyperlink selected: "+ data$
- popup "リンク先をロード中",0,0,1
- ! HTML.LOAD.URL data$
- browse data$
- SW.BREAK
- ! An error occured
- SW.CASE "ERR:"
- PRINT "Error: " + data$
- popup "エラーが発生しました 終了します",0,0,0
- pause 2000
- exit
- SW.BREAK
- ! User data returned
- SW.CASE "DAT:"
- PRINT "User data: " + data$
- ! Check for Exit
- IF data$ = "//x//" then
- PRINT "User ended demo."
- HTML.CLOSE
- popup "終了します",0,0,0
- pause 5000
- exit
- else
- msx$=data$+"←データの内容"
- popup msx$,0,0,0
- if left$(data$,5)="//b//" then
- spwk$=mid$(data$,6)
- tts.init
- tts.speak spwk$
- tts.stop
- goto xnextUserAction
- endif
- if left$(data$,5)="//y//" then
- popup "ファイル保存開始",0,0,1
- svwk$=mid$(data$,6)
- cls
- print svwk$
- console.save "stttts.txt"
- pause 1000
- print "◆◆◆ 上記内容を保存しました"
- popup "ファイル保存終了",0,0,1
- goto xnextUserAction
- endif
- if left$(data$,5)="//a//" then
- html.close
- console.title "録音準備中"
- pause 4000
- spwk2$=mid$(data$,6)
- console.title "録音開始"
- cls
- print "録音を開始しました"
- recstart:
- stt.listen
- stt.results thelist
- list.size thelist,thesize
- print "選択候補の出力"
- for k=1 to thesize
- list.get thelist,k,thetext$
- print str$(k);":";thetext$
- next k
- List.add thelist,"exit"
- Dialog.select selx,thelist,"選択してください"
- list.get thelist,selx,seltext$
- print "選択結果: ";
- print seltext$
- list.clear thelist
- if seltext$="exit" then
- console.title "録音完了→更新開始"
- hokan$=spwk2$
- goto allstart
- else
- console.title "録音継続中"
- spwk2$=spwk2$+"\n"+seltext$+"。"
- goto recstart
- endif
- goto allstart
- endif
- html.close
- pause 5000
- ! run data$
- goto nxttest
- ENDIF
- SW.BREAK
- ! Form data returned.
- ! Note: Form data returning
- ! always exits the html.
- SW.CASE "FOR:"
- PRINT "Form data: "+data$
- popup "終了します",0,0,0
- pause 2000
- exit
- SW.BREAK
- SW.DEFAULT
- PRINT "Unexpected data type:", type$ + data$
- popup "終了します",0,0,0
- pause 2000
- exit
- SW.END
- GOTO xnextUserAction
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement