Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 29 lines (21 sloc) 665 Bytes
import asyncio
import sys
import piaudio
def Main():
music = piaudio.Music('audio/Joust/music/classical.wav')
music.start_audio_loop()
loop = asyncio.get_event_loop()
print("Enter a FP number:")
async def ProcessInput():
while True:
line = await loop.run_in_executor(None, sys.stdin.readline)
try:
ratio = float(line)
except ValueError:
print("invalid value: %s" % line)
await music.transition_ratio(ratio)
print("OK.")
loop.run_until_complete(ProcessInput())
music.stop_audio()
if __name__ == '__main__':
Main()