added tts

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2019-09-03 14:54:42 -05:00
parent 57a11419e3
commit a36509898b
24 changed files with 130 additions and 8 deletions

Binary file not shown.

View File

@ -0,0 +1,12 @@
#Import libraries
from termcolor import colored
import sys
#Introduction
print(colored("<<connect4-2D.", 'red')+colored("p", 'blue')+colored("y", 'yellow'), colored("- Written by Caleb Fontenot>>", 'red'))
print("~~Experimental Version~~"+'\n')
#Import connectCore.py
import connectCore
print("Successfully imported connectCore!"+'\n')
#Import pygame
import pygame

View File

@ -0,0 +1,13 @@
#Let's first check if this script is being run by a frontend or not
print("__name__ is set to", __name__)
if __name__ == '__main__':
print("This script isn't ment to be run by itself! Please run it with either connect4-2D or 3D!")
#Import libraries
from termcolor import colored
#Versioning info
print(colored("<<connectCore.", 'red')+colored("p", 'blue')+colored("y", 'yellow'), colored("- Written by Caleb Fontenot>>", 'red'))
print("~~Experimental Version~~"+'\n')
#setup grid dict
grid = {(i, j): None for i in range(7) for j in range(6)}
#manipulating red
#grid[0, 3] = 'red'

BIN
madlibs/TTS.mp3 Normal file

Binary file not shown.

View File

@ -4,7 +4,7 @@ debug = 1
# Import the libraries we will use # Import the libraries we will use
from datetime import datetime from datetime import datetime
import pyttsx from gtts import gTTS
import re import re
import sys import sys
import random import random
@ -12,7 +12,7 @@ import platform
import argparse import argparse
import os import os
# init tts # init tts
engine = pyttsx.init()
# check to see if termcolor is installed, we need it for color to work # check to see if termcolor is installed, we need it for color to work
try: try:
from termcolor import colored from termcolor import colored
@ -136,9 +136,6 @@ generatedStory = generatedStory.join(storyContentList)
#generatedStoryColored = generatedStoryColored.join(storyContentListColored) #generatedStoryColored = generatedStoryColored.join(storyContentListColored)
#print(generatedStoryColored) #print(generatedStoryColored)
print(generatedStory) print(generatedStory)
# say the tts
engine.say('generatedStory')
engine.run()
#print(exec(generatedStoryColored)) #print(exec(generatedStoryColored))
#exit() #exit()
#Alright! We're done! Let's save the story to a file #Alright! We're done! Let's save the story to a file
@ -165,3 +162,12 @@ file.write(filteredTitle[0]+'\n'+'\n')
file.write(generatedStory) file.write(generatedStory)
file.write('\n'+"Generated by Caleb Fontenot\'s madlibs.py") file.write('\n'+"Generated by Caleb Fontenot\'s madlibs.py")
file.close() file.close()
# say the tts
print('\n'+"Processing Text-To-Speech, please wait..."+'\n')
tts = gTTS(text=generatedStory, lang='en')
tts.save("TTS.mp3")
#os.system("play TTS.mp3")
os.system("cp TTS.mp3 \"saved stories\\"")

View File

@ -0,0 +1,5 @@
Three Little Pigs
Once upon a time, there were three asdf pigs. One day, their mother said, "You are all grown up and must asdf on your own." So they left to asdf their houses. The first little pig wanted only to asfdd all day and quickly built his house out of as. The second little pig wanted to fd and afsd all day so he afsd his house with asdf. The third asdf pig knew the wolf lived nearby and worked hard to afsd his house out of asfd. One day, the wolf knocked on the first pig's asdf. "Let me in or I'll a your house down!" The pig didn't, so the wolf sdf down the sdf. The wolf knocked on the second pig's fads. "Let me in or I'll blow your down!" The pig didn't, so the wolf asdf down the house. Then the wolf knocked on the third asdf pig's door. "Let me in or I'll blow your house down!" The little pig didn't, so the wolf and .He could not blow the house down. All the pigs went to live in the asf house and they all sadf happily ever after.
Generated by Caleb Fontenot's madlibs.py

View File

@ -0,0 +1,4 @@
MadLib Gameshow
1 on down! You're the next contestant on 2's new gameshow, MadLib! Here's how it works. You will 3 over a 4 at a rate of 5 mph. After you jump over that item, you will 6 over to the 7 8 and press the 9 at the end. 10 time wins! Oh. I forgot to introduce our host. He's a 11 person who can't wait to 12 in to the show. Please welcome, 13! Alright players, on your mark. Get set. 14! Alright, here goes 15 on the first stage of the competition. And.. WOAH! He just 16 over the thing! That's gonna hurt him tommorow. But it'll be all worth it after he wins the grand prize of 17 dollars! Which he says will go towards 18. Very 19 investment, but it's his money! Here he comes around the second leg. AND WOAH, AGAIN HE LOOKS 20 ON NETWORK TELEVISION! This is what primetime is all about here on the network of 21. And, he presses it! He finishes with a time of 22. Will that be enough to win? Find out on 23 when 24 will challenge him for the grand prize. For all of us here at MadLib, good night everyone!
Generated by Caleb Fontenot's madlibs.py

View File

@ -0,0 +1,4 @@
MadLib Gameshow
slowly on down! You're the next contestant on Donald Trump's new gameshow, MadLib! Here's how it works. You will exclaimed over a Tory at a rate of 72 billion mph. After you jump over that item, you will thought over to the quick Razer Phone and press the Razer Phone 2 at the end. stupidly time wins! Oh. I forgot to introduce our host. He's a questionibly person who can't wait to fast in to the show. Please welcome, Mr. Tory what is a Proper Name! Alright players, on your mark. Get set. Tory! Alright, here goes Tory on the first stage of the competition. And.. WOAH! He just fasted over the thing! That's gonna hurt him tommorow. But it'll be all worth it after he wins the grand prize of 72 billion dollars! Which he says will go towards 1TB Hard Drive. Very strange investment, but it's his money! Here he comes around the second leg. AND WOAH, AGAIN HE LOOKS weird ON NETWORK TELEVISION! This is what primetime is all about here on the network of Discovery Family. And, he presses it! He finishes with a time of 5:52 PM. Will that be enough to win? Find out on Friday when Fiona from Shrek will challenge him for the grand prize. For all of us here at MadLib, good night everyone!
Generated by Caleb Fontenot's madlibs.py

View File

@ -0,0 +1,4 @@
MadLib Gameshow
g on down! You're the next contestant on agdsg's new gameshow, MadLib! Here's how it works. You will agsd over a asdg at a rate of a mph. After you jump over that item, you will sddg over to the as gasd and press the gas at the end. dg time wins! Oh. I forgot to introduce our host. He's a ag person who can't wait to asd in to the show. Please welcome, gasd! Alright players, on your mark. Get set. gasd! Alright, here goes g on the first stage of the competition. And.. WOAH! He just asdg over the thing! That's gonna hurt him tommorow. But it'll be all worth it after he wins the grand prize of asd dollars! Which he says will go towards gas. Very gadsg investment, but it's his money! Here he comes around the second leg. AND WOAH, AGAIN HE LOOKS as ON NETWORK TELEVISION! This is what primetime is all about here on the network of ggdasg. And, he presses it! He finishes with a time of asdgag. Will that be enough to win? Find out on adsg when asdd will challenge him for the grand prize. For all of us here at MadLib, good night everyone!
Generated by Caleb Fontenot's madlibs.py

View File

@ -0,0 +1,4 @@
MadLib Gameshow
talked on down! You're the next contestant on Edgar Wright's new gameshow, MadLib! Here's how it works. You will mute over a Intel i9-9990k Processor at a rate of 130 mph. After you jump over that item, you will raid over to the born card and press the Twitch Prime at the end. rich time wins! Oh. I forgot to introduce our host. He's a scared person who can't wait to snap in to the show. Please welcome, Rotocraft LLC! Alright players, on your mark. Get set. floobin! Alright, here goes PePega on the first stage of the competition. And.. WOAH! He just danced over the thing! That's gonna hurt him tommorow. But it'll be all worth it after he wins the grand prize of two thousand two hundred and thirty dollars! Which he says will go towards cash register. Very bent investment, but it's his money! Here he comes around the second leg. AND WOAH, AGAIN HE LOOKS sad ON NETWORK TELEVISION! This is what primetime is all about here on the network of Hub Network. And, he presses it! He finishes with a time of noon. Will that be enough to win? Find out on January when Adorabat will challenge him for the grand prize. For all of us here at MadLib, good night everyone!
Generated by Caleb Fontenot's madlibs.py

View File

@ -0,0 +1,5 @@
Three Little Pigs
Once upon a time, there were three annoying pigs. One day, their mother said, "You are all grown up and must fly on your own." So they left to selects their houses. The first little pig wanted only to calculate all day and quickly built his house out of bats. The second little pig wanted to send and resize all day so he sent his house with computers. The third hot pig knew the wolf lived nearby and worked hard to closed his house out of DVD copies of Monty Python trade mark and the holy grail. One day, the wolf knocked on the first pig's key. "Let me in or I'll open your house down!" The pig didn't, so the wolf swiped down the button. The wolf knocked on the second pig's pig. "Let me in or I'll blow your tank down!" The pig didn't, so the wolf locked down the house. Then the wolf knocked on the third purple pig's door. "Let me in or I'll blow your house down!" The little pig didn't, so the wolf meowed and yelled.He could not blow the house down. All the pigs went to live in the dab house and they all read happily ever after.
Generated by Caleb Fontenot's madlibs.py

View File

@ -0,0 +1,5 @@
Three Little Pigs
Once upon a time, there were three asdf pigs. One day, their mother said, "You are all grown up and must sadf on your own." So they left to asdf their houses. The first little pig wanted only to asd all day and quickly built his house out of fas. The second little pig wanted to dfasdf and asdf all day so he asd his house with asdghasd. The third gas pig knew the wolf lived nearby and worked hard to gas his house out of gas. One day, the wolf knocked on the first pig's e. "Let me in or I'll agasefgasdgasga your house down!" The pig didn't, so the wolf sdg down the asdg. The wolf knocked on the second pig's asdg. "Let me in or I'll blow your as down!" The pig didn't, so the wolf g down the house. Then the wolf knocked on the third asd pig's door. "Let me in or I'll blow your house down!" The little pig didn't, so the wolf gasd and gasd.He could not blow the house down. All the pigs went to live in the gasdg house and they all a happily ever after.
Generated by Caleb Fontenot's madlibs.py

View File

@ -0,0 +1,5 @@
Three Little Pigs
Once upon a time, there were three sdgf pigs. One day, their mother said, "You are all grown up and must sdf on your own." So they left to gsd their houses. The first little pig wanted only to h all day and quickly built his house out of sfdh. The second little pig wanted to sh and sfd all day so he sfd his house with hsdf. The third h pig knew the wolf lived nearby and worked hard to sdfh his house out of sdfhsd. One day, the wolf knocked on the first pig's fdhs. "Let me in or I'll dfh your house down!" The pig didn't, so the wolf sdf down the hsdf. The wolf knocked on the second pig's hs. "Let me in or I'll blow your dh down!" The pig didn't, so the wolf e4r down the house. Then the wolf knocked on the third qrr pig's door. "Let me in or I'll blow your house down!" The little pig didn't, so the wolf qewr and qwer.He could not blow the house down. All the pigs went to live in the house and they all qwer happily ever after.
Generated by Caleb Fontenot's madlibs.py

Binary file not shown.

BIN
madlibs/saved\ stories.mp3 Normal file

Binary file not shown.

View File

@ -1,2 +1,4 @@
<MadLib Gameshow>
<verb> on down! You're the next contestant on <celebrity>'s new gameshow, MadLib! Here's how it works. You will <verb> over a <noun> at a rate of <number> mph. After you jump over that item, you will <verb> over to the <adjective> <noun> and press the <noun> at the end. <adjective> time wins! Oh. I forgot to introduce our host. He's a <adjective> person who can't wait to <verb> in to the show. Please welcome, <proper name>! Alright players, on your mark. Get set. <silly word>! Alright, here goes <boy's name> on the first stage of the competition. And.. WOAH! He just <verb ending in ed> over the thing! That's gonna hurt him tommorow. But it'll be all worth it after he wins the grand prize of <number> dollars! Which he says will go towards <item you find at a store>. Very <adjective> investment, but it's his money! Here he comes around the second leg. AND WOAH, AGAIN HE LOOKS <adjective> ON NETWORK TELEVISION! This is what primetime is all about here on the network of <tv network>. And, he presses it! He finishes with a time of <time>. Will that be enough to win? Find out on <day of week> when <girl's name> will challenge him for the grand prize. For all of us here at MadLib, good night everyone!
<Three Little Pigs> <Three Little Pigs>
Once upon a time, there were three <adjective> pigs. One day, their mother said, "You are all grown up and must <verb> on your own." So they left to <verb> their houses. The first little pig wanted only to <verb> all day and quickly built his house out of <plural noun>. The second little pig wanted to <verb> and <verb> all day so he <past tense verb> his house with <plural noun>. The third <adjective> pig knew the wolf lived nearby and worked hard to <verb> his house out of <plural noun>. One day, the wolf knocked on the first pig's <noun>. "Let me in or I'll <verb> your house down!" The pig didn't, so the wolf <past tense verb> down the <noun>. The wolf knocked on the second pig's <noun>. "Let me in or I'll blow your <noun> down!" The pig didn't, so the wolf <past tense verb> down the house. Then the wolf knocked on the third <adjective> pig's door. "Let me in or I'll blow your house down!" The little pig didn't, so the wolf <past tense verb> and <past tense verb>.He could not blow the house down. All the pigs went to live in the <noun> house and they all <past tense verb> happily ever after. Once upon a time, there were three <adjective> pigs. One day, their mother said, "You are all grown up and must <verb> on your own." So they left to <verb> their houses. The first little pig wanted only to <verb> all day and quickly built his house out of <plural noun>. The second little pig wanted to <verb> and <verb> all day so he <past tense verb> his house with <plural noun>. The third <adjective> pig knew the wolf lived nearby and worked hard to <verb> his house out of <plural noun>. One day, the wolf knocked on the first pig's <noun>. "Let me in or I'll <verb> your house down!" The pig didn't, so the wolf <past tense verb> down the <noun>. The wolf knocked on the second pig's <noun>. "Let me in or I'll blow your <noun> down!" The pig didn't, so the wolf <past tense verb> down the house. Then the wolf knocked on the third <adjective> pig's door. "Let me in or I'll blow your house down!" The little pig didn't, so the wolf <past tense verb> and <past tense verb>.He could not blow the house down. All the pigs went to live in the <noun> house and they all <past tense verb> happily ever after.

View File

@ -0,0 +1,2 @@
<Three Little Pigs>
Once upon a time, there were three <adjective> pigs. One day, their mother said, "You are all grown up and must <verb> on your own." So they left to <verb> their houses. The first little pig wanted only to <verb> all day and quickly built his house out of <plural noun>. The second little pig wanted to <verb> and <verb> all day so he <past tense verb> his house with <plural noun>. The third <adjective> pig knew the wolf lived nearby and worked hard to <verb> his house out of <plural noun>. One day, the wolf knocked on the first pig's <noun>. "Let me in or I'll <verb> your house down!" The pig didn't, so the wolf <past tense verb> down the <noun>. The wolf knocked on the second pig's <noun>. "Let me in or I'll blow your <noun> down!" The pig didn't, so the wolf <past tense verb> down the house. Then the wolf knocked on the third <adjective> pig's door. "Let me in or I'll blow your house down!" The little pig didn't, so the wolf <past tense verb> and <past tense verb>.He could not blow the house down. All the pigs went to live in the <noun> house and they all <past tense verb> happily ever after.

View File

@ -1 +1 @@
1 2

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

View File

@ -0,0 +1,25 @@
import sys, pygame
pygame.init()
size = width, height = 800, 800
speed = [1, 2]
black = 0, 0, 100
screen = pygame.display.set_mode(size)
ball = pygame.image.load("intro_ball.gif")
ballrect = ball.get_rect()
while 1:
for event in pygame.event.get():
if event.type == pygame.QUIT: sys.exit()
print(pygame.mouse.get_pos)
ballrect = ballrect.move(speed)
if ballrect.left < 0 or ballrect.right > width:
speed[0] = -speed[0]
if ballrect.top < 0 or ballrect.bottom > height:
speed[1] = -speed[1]
screen.fill(black)
screen.blit(ball, ballrect)
pygame.display.flip()

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

View File

@ -0,0 +1,20 @@
#import pyglet
import pyglet
#Define image
image = pyglet.resource.image('Twi.png')
#Make Window
window = pyglet.window.Window()
#Make Label
label = pyglet.text.Label('Hello, world',
font_name='Times New Roman',
font_size=36,
x=window.width//2, y=window.height//2,
anchor_x='center', anchor_y='center')
#Draw thing I guess
@window.event
def on_draw():
window.clear()
image.blit(0, 0)
label.draw()
#Run Window
pyglet.app.run()

View File

@ -0,0 +1,6 @@
from gtts import gTTS
import os
text2electricboogaloo = input("Enter Text: ")
tts = gTTS(text=text2electricboogaloo, lang='en')
tts.save("good.mp3")
os.system("play good.mp3")