I'm building a compas, which is a particular flamenco metronome. I want to direct the sound to Jack Audio. I'm using Python and PySide. So I'm using the PyJack library to process a wave file in jack:
def launchSoundThread(
for sample in sampleWavs[sampleNumber]:
try:
compas_client.process(sample, input_samples)
except jack.InputSyncError:
print("InputSyncError")
except jack.OutputSyncError:
print("OutputSyncError")
My problem is, while processing the sound, the UI freezes. Threads don't help because of the Python Tiplock. So I'm trying to use multiprocessing and async functions:
pool = Pool(1)
r = pool.apply_async(launchSoundThread, args=() )
or
audio_process = Process( target=launchSoundThread, rgs=( ))
audio_process.start()
Neither of them work. They both get stuck while processing the audio and don't produce any sound.
Any suggestions? Many Thanks in advance Federico