Last active
March 31, 2019 20:55
-
-
Save MikeTheWatchGuy/5ac1fe5432f4fae5f12546044616d3f1 to your computer and use it in GitHub Desktop.
Duplication of GUI presented on Reddit, just to see what it would be like to write.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PySimpleGUI as sg | |
import subprocess | |
def slider(key, initial_value): | |
return [sg.Slider((1, 200), resolution=0, default_value=initial_value, orientation='h', size=(10,15),key=key)] | |
layout = [ [sg.Text('Pitch')], slider('pitch', 64), | |
[sg.Text('Speed')], slider('speed',72), | |
[sg.Text('Mouth')], slider('mouth',128), | |
[sg.Text('Throat')],slider('throat',128), | |
[sg.CBox('Phoenetic', key='CBP')], [sg.CBox('Save', key='CBS')],[sg.CBox('Output', key='CBO')], | |
[sg.Input('Commodore64', key='SaveName', size=(16,1))], | |
[sg.Button('Play')]] | |
window = sg.Window('Commodore 64').Layout(layout) | |
while True: | |
event, v = window.Read() | |
if event is None: | |
break | |
if event == 'Play': | |
command = f"sam.exe -pitch {int(v['pitch'])} -speed {int(v['speed'])} -mouth {int(v['mouth'])} -throat {int(v['throat'])} {v['SaveName']}" | |
if v['CBP']: | |
command += f" -phoenetic {1*v['CBP']}" | |
if v['CBS']: | |
command += f" -wav {v['SaveName']}_p{int(v['pitch'])}m{int(v['mouth'])}s{int(v['speed'])}t{int(v['throat'])}.wav" | |
if v['CBO']: | |
subprocess.call(command) | |
print(command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code duplicates the code located in this Reddit post
https://www.reddit.com/r/Python/comments/b7qsf5/made_a_gui_for_a_c64_speech_synthesizer_and_a/