SHARE
TWEET

Untitled

a guest Feb 20th, 2020 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import simpleaudio as sa
  2. import asyncio
  3. from time import sleep as sleep
  4. dirk = 'loops'
  5. wave_obj1 = sa.WaveObject.from_wave_file(dirk+'Crodex 128BPM.wav')
  6. wave_obj2= sa.WaveObject.from_wave_file(dirk+'FX 128BPM.wav')
  7. wave_obj3 = sa.WaveObject.from_wave_file(dirk+'Loop 128BPM.wav')
  8. async def uploader():
  9.     await runner(False,False)
  10. async def runner(souka,kamin):
  11.     if kamin:
  12.         play_obj = souka.play()
  13.         play_obj.wait_done()  # Подождите, пока звук не закончится
  14.     else:
  15.         pass
  16. def run_async_background(coro):
  17.     def func():
  18.         loop = asyncio.new_event_loop()
  19.         loop.run_until_complete(runner())
  20.         loop.close()
  21.     Thread(target=func).start()
  22. loop = asyncio.get_event_loop()
  23. loop.run_until_complete(uploader())
  24. loop.close()
  25. print('3')
  26. sleep(1)
  27. print('2')
  28. sleep(1)
  29. print('1')
  30. sleep(1)
  31. print('Sanya LOX!!!')
  32. run_async_background(runner(wave_obj1,True))
  33. run_async_background(runner(wave_obj2,True))
  34. run_async_background(runner(wave_obj3,True))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top