0

我刚刚使用这种编程语言创建了一个文本到语音转换器。

代码是,

DO
    CLS
    PRINT "This is the program built by Adhikari Newtorks Team Using QBASIC..........."
    PRINT "This is a text to speech converter.."
    PRINT
    PRINT
    INPUT "Enter the word to pronounce: ", speak$
    OPEN "sound.vbs" FOR OUTPUT AS #1
    PRINT #1, "dim speechobject"
    PRINT #1, "set speechobject=createobject ("; CHR$(34); "sapi.spvoice"; CHR$(34); ")"
    PRINT #1, "speechobject.speak"; CHR$(34); speak$; CHR$(34)
    CLOSE #1
    SHELL "sound.vbs"
    KILL "sound.vbs"
LOOP

你知道,我在这里用这种语言编写了一个可视化的基本代码。我的主要困惑是,我可以说这个程序是使用 QBASIC 编程语言构建的,还是应该称它为 Visual Basic 程序?

4

1 回答 1

5

这是一个启动 VBScript 的 QBasic 程序。

虽然我真的不明白这一点。好像已经有人评论过了,为什么不直接写一个vbscript呢?它也将是更短的代码,如下所示:

Do 
   str = InputBox("Enter the word to pronounce","Enter text")
   Dim speechobject
   Set speechobject = createobject("sapi.spvoice")
   speechobject.speak str
Loop Until (str = "")

如果你想在命令提示符下运行它,你可以输入:cscript /nologo myscript.vbs

于 2016-06-25T20:36:04.880 回答