Posted 25 July 2013 - 12:14 AM
ComputerCraft Version: [1.53]
Mod Pack: "Direwolf20_1_5 v1.0.0"
Hey pros,
So I've been playing around ComputerCraft, and I've noticed that within Direwolf20's 1.5 pack, it includes "MiscPeripherals". (Forum Link, here.) There was one block that caught my attention, the Speaker. With an Advanced Computer, running the program "speak" allows you to type in any text, then it will execute an audible text-to-speech. Playing around with this gave me a lot of ideas, and I don't know how I would code any of it. I've looked around for a specific API for the speaker itself, nothing, and I've tried already existing API's and shell.run's. (Perhaps I'm not familiar enough with Lua to properly utilize them.)
Doing a shell.run of "shell.run("speaker", print("Hello World"))" Would print "Hello World", and THEN start up the speak program. What I was hoping it would do is run speak, it would input "Hello World", then it would text-to-speech it.
Is there a way to input text by code into an already existing program? Or could anyone be specific on how you would create API for such a peripheral?
I was thinking of things like:
speaker.readSpeed() | Change the text-to-speech reading speed. | Example: speaker.readSpeed(0.5) –Slow voice.
speaker.readText() | Input text to be read out loud. | Example: speaker.readText("Hello World.") –Would text-to-speech, "Hello World."
speaker.speechAudio() | Change the volume level of the text-to-speech. | Example: speaker.speechAudio(10) –Loudest.
So thinking of a small test program that would be fun to utilize this would probably be something like…
term.setCursorPos(14,2)
print("Test Speech")
term.setCursorPos(14,3)
print("———–")
print(" ")
sleep(0.7)
term.setCursorPos(10,6)
speaker.readText("Hello User, what would you like to do?")
textutils.slowPrint("Hello User, what would you like to do?")
Here are some images of the speaker:
Here it is under MiscPeripherals in the Creative menu.
Here is the speaker placed in the world.
On the left advanced computer, the speaker is behind it.
And this is running "speak", typing in "Hello World", and a voice will read it out loud.
Any help or ideas will be greatly appreciated.
Thanks,
Xerxeth
Mod Pack: "Direwolf20_1_5 v1.0.0"
Hey pros,
So I've been playing around ComputerCraft, and I've noticed that within Direwolf20's 1.5 pack, it includes "MiscPeripherals". (Forum Link, here.) There was one block that caught my attention, the Speaker. With an Advanced Computer, running the program "speak" allows you to type in any text, then it will execute an audible text-to-speech. Playing around with this gave me a lot of ideas, and I don't know how I would code any of it. I've looked around for a specific API for the speaker itself, nothing, and I've tried already existing API's and shell.run's. (Perhaps I'm not familiar enough with Lua to properly utilize them.)
Doing a shell.run of "shell.run("speaker", print("Hello World"))" Would print "Hello World", and THEN start up the speak program. What I was hoping it would do is run speak, it would input "Hello World", then it would text-to-speech it.
Is there a way to input text by code into an already existing program? Or could anyone be specific on how you would create API for such a peripheral?
I was thinking of things like:
speaker.readSpeed() | Change the text-to-speech reading speed. | Example: speaker.readSpeed(0.5) –Slow voice.
speaker.readText() | Input text to be read out loud. | Example: speaker.readText("Hello World.") –Would text-to-speech, "Hello World."
speaker.speechAudio() | Change the volume level of the text-to-speech. | Example: speaker.speechAudio(10) –Loudest.
So thinking of a small test program that would be fun to utilize this would probably be something like…
term.setCursorPos(14,2)
print("Test Speech")
term.setCursorPos(14,3)
print("———–")
print(" ")
sleep(0.7)
term.setCursorPos(10,6)
speaker.readText("Hello User, what would you like to do?")
textutils.slowPrint("Hello User, what would you like to do?")
Here are some images of the speaker:
Here it is under MiscPeripherals in the Creative menu.
Here is the speaker placed in the world.
On the left advanced computer, the speaker is behind it.
And this is running "speak", typing in "Hello World", and a voice will read it out loud.
Any help or ideas will be greatly appreciated.
Thanks,
Xerxeth